:root {
  --sidebar-width: 280px;
  --sidebar-width-collapsed: 88px;
  --app-gradient: radial-gradient(circle at 20% 20%, rgba(78, 51, 150, 0.45), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(74, 222, 128, 0.12), transparent 25%),
    #0c1224;
}

* {
  box-sizing: border-box;
}

body.theme-dark {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  position: relative;
  background: #0c1224;
  color: #e5e7eb;
}

body.theme-dark::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--app-gradient);
  background-attachment: fixed;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width, 280px) minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
  transition: grid-template-columns 0.25s ease;
}

.layout.sidebar-collapsed {
  grid-template-columns: var(--sidebar-width-collapsed, 88px) minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #11172a 0%, #0c1224 100%);
  padding: 32px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 32px;
  transition: padding 0.25s ease;
  position: sticky;
  top: 0;
  width: var(--sidebar-width, 280px);
  flex: 0 0 var(--sidebar-width, 280px);
  min-width: var(--sidebar-width, 280px);
  max-width: var(--sidebar-width, 280px);
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
  height: 100vh;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #e5e7eb;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #e5e7eb;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-subtitle {
  color: #94a3b8;
}

.collapse-toggle {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  align-self: flex-start;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: sticky;
  bottom: 24px;
}

.collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.layout.sidebar-collapsed .collapse-toggle {
  transform: rotate(180deg);
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-footer {
  padding-top: 4px;
  display: flex;
  justify-content: flex-start;
}

.sidebar-cta {
  display: flex;
}

.sidebar .cta-button {
  width: 100%;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 14px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  position: relative;
}

.menu-item:hover,
.menu-item.active {
  color: #e5e7eb;
  background: rgba(124, 58, 237, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  margin-left: auto;
}

.menu-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  color: #a855f7;
  display: grid;
  place-items: center;
}

.menu-icon svg {
  width: 20px;
  height: 20px;
}

.menu-label {
  flex: 1;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  color: white;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(124, 58, 237, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  font-size: 16px;
  display: inline-flex;
}

.content {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-chip {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.35);
  color: white;
  font-weight: 700;
}

.api-url {
  color: #94a3b8;
  font-size: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  padding: 18px;
  border-radius: 16px;
  background: #11172a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card-label {
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 12px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 6px;
}

.gradient {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(14, 165, 233, 0.2));
}

.gradient-purple {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.5), rgba(22, 163, 74, 0.1));
}

.gradient-blue {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.5), rgba(59, 130, 246, 0.2));
}

.evaluation,
.search {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18);
}

.btn-secondary {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #e5e7eb;
  cursor: pointer;
}

.search-input {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-input input {
  background: transparent;
  border: none;
  color: #e5e7eb;
  width: 240px;
}

.search-input input:focus {
  outline: none;
}

.analysis-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.analysis-tabs .tab {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
}

.analysis-tabs .tab.active {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.35);
}

.analysis-tabs .tab:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.analysis-sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.table-wrapper {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.table-card {
  background: #11172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.25);
  overflow-x: auto;
  min-width: 0;
}

.table-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.table-card.is-collapsed {
  padding-bottom: 12px;
}

.table-card.is-collapsed header {
  margin-bottom: 0;
}

.table-card header strong {
  font-size: 16px;
  color: #f8fafc;
}

.table-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.table-collapse {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.table-collapse:hover,
.table-collapse:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.table-collapse:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 2px;
}

.collapse-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 14px;
}

.table-card.is-collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.table-content {
  background: #11172a;
}

.table-content[aria-hidden='true'] {
  display: none;
}

.table-card table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  background: #11172a;
}

.table-card th,
.table-card td {
  padding: 12px 14px;
  text-align: left;
  color: #e2e8f0;
}

.table-card th {
  position: sticky;
  top: 0;
  background: #0f172a;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  z-index: 1;
}

.table-card thead th:first-child {
  border-top-left-radius: 12px;
}

.table-card thead th:last-child {
  border-top-right-radius: 12px;
}

.table-card tbody tr:nth-child(odd) td {
  background: #0f1628;
}

.table-card tbody tr:nth-child(even) td {
  background: #141c33;
}

.table-card tbody tr:hover td {
  background: #2c1a45;
}

.table-card tbody td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.table-card td.editable:focus-visible {
  outline: 1px solid rgba(168, 85, 247, 0.7);
  background: #27163f;
}

.table-card .pill.ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.analysis-block {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 4px solid rgba(124, 58, 237, 0.7);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}

.analysis-block__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.analysis-block__header h4 {
  margin: 6px 0 4px;
}

.analysis-block.is-inactive {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.08);
  border-left-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  opacity: 0.9;
}

.analysis-block.is-inactive .muted,
.analysis-block.is-inactive .overline {
  color: rgba(148, 163, 184, 0.85);
}

.analysis-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #cbd5e1;
  font-weight: 600;
  position: relative;
}

.analysis-toggle .toggle-label {
  display: inline-flex;
  align-items: center;
}

.analysis-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.analysis-toggle .toggle-visual {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  padding: 4px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.analysis-toggle .toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e5e7eb;
  transform: translateX(0);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.analysis-toggle input:checked + .toggle-label + .toggle-visual,
.analysis-toggle input:checked + .toggle-label + .toggle-visual .toggle-knob {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.analysis-toggle input:checked + .toggle-label + .toggle-visual {
  border-color: rgba(168, 85, 247, 0.6);
}

.analysis-toggle input:checked + .toggle-label + .toggle-visual .toggle-knob {
  transform: translateX(18px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
  background: #fff;
}

.analysis-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.2s ease;
}

.analysis-fields.is-collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  margin-top: 0;
  gap: 0;
}

.analysis-empty-state {
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.analysis-empty-state h4 {
  margin: 6px 0 0;
}

.empty-state {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  text-align: center;
}

.hidden {
  display: none !important;
}

.kbd {
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #e5e7eb;
}

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

.sparkline {
  width: 120px;
  height: 48px;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.6), rgba(124, 58, 237, 0.1));
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.sparkline::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.trend-label {
  color: #94a3b8;
  font-weight: 600;
}

.data-grid {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 18px;
}

.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

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

.pill {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grid-table {
  display: grid;
  gap: 8px;
}

.grid-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr 1fr;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.grid-row.head {
  background: transparent;
  border: none;
  color: #94a3b8;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.dot-ok {
  background: linear-gradient(135deg, #4ade80, #22c55e);
}

.layout.sidebar-collapsed .sidebar {
  padding: 24px 16px;
  width: var(--sidebar-width-collapsed, 88px);
  min-width: var(--sidebar-width-collapsed, 88px);
  max-width: var(--sidebar-width-collapsed, 88px);
  flex: 0 0 var(--sidebar-width-collapsed, 88px);
  flex-shrink: 0;
}

.layout.sidebar-collapsed .sidebar .brand-text,
.layout.sidebar-collapsed .sidebar .brand-subtitle,
.layout.sidebar-collapsed .sidebar .menu-label,
.layout.sidebar-collapsed .sidebar .badge,
.layout.sidebar-collapsed .sidebar .btn-label {
  display: none;
}

.layout.sidebar-collapsed .sidebar .cta-button {
  justify-content: center;
  padding: 14px;
}

.layout.sidebar-collapsed .menu-item {
  justify-content: center;
  padding: 12px;
}

.layout.sidebar-collapsed .menu-item::after,
.layout.sidebar-collapsed .sidebar .cta-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(17, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.layout.sidebar-collapsed .menu-item:hover::after,
.layout.sidebar-collapsed .sidebar .cta-button:hover::after {
  opacity: 1;
  transform: translate(6px, -50%);
}

.layout.sidebar-collapsed .sidebar .cta-button {
  position: relative;
}

.layout.sidebar-collapsed .brand-icon {
  width: 40px;
  height: 40px;
}

.layout.sidebar-collapsed .sidebar-header {
  padding-right: 48px;
}

.menu-item:hover .menu-icon,
.menu-item.active .menu-icon {
  color: #e5e7eb;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  visibility: hidden;
  opacity: 0;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  z-index: 1200;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.active,
.modal[aria-hidden='false'] {
  display: flex;
  visibility: visible;
  opacity: 1;
}

.modal[aria-hidden='true'] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 36, 0.7);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  width: min(960px, 96vw);
  max-height: 90vh;
  background: #0f172a;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 12px;
}

.modal-header .icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #dbeafe;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
}

.modal-header .icon-button:hover,
.modal-header .icon-button:focus-visible {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(168, 85, 247, 0.4));
  border-color: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
  outline: none;
}

.modal-body {
  padding: 0 24px 24px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full-span {
  grid-column: 1 / -1;
}

.field span {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
}

.field-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-helper {
  color: #94a3b8;
  font-size: 13px;
  margin: 0;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease,
    color 0.2s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.field select:hover {
  border-color: #a855f7;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.14);
}

.field select:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25), 0 8px 18px rgba(124, 58, 237, 0.14);
  background: #fff;
  color: #0f172a;
}

.field select option {
  color: #e5e7eb;
  background: rgba(12, 18, 36, 0.9);
}

.field select:focus option {
  background: #fff;
  color: #0f172a;
}

.analysis-toggle-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.chip-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.chip-toggle:hover {
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.2);
  transform: translateY(-1px);
}

.chip-toggle.is-selected {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(168, 85, 247, 0.35));
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 14px 36px rgba(124, 58, 237, 0.35);
}

.chip-marker {
  font-size: 14px;
  color: #a855f7;
  opacity: 0.8;
}

.chip-toggle.is-selected .chip-marker {
  color: #c084fc;
}

.chip-title {
  font-weight: 700;
}

.chip-subtitle {
  display: block;
  font-size: 12px;
  color: #cbd5e1;
}

.chip-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chip-action {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.chip-action.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
}

.chip-action:hover,
.chip-action:focus-visible {
  border-color: rgba(124, 58, 237, 0.55);
  background: rgba(124, 58, 237, 0.12);
  color: #ede9fe;
  outline: none;
}

.criteria-card,
.previous-filters {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.criteria-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.criteria-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.criteria-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) 120px;
  gap: 12px;
  align-items: end;
}

.criteria-row .remove-row {
  align-items: center;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 24px;
  color: #fecdd3;
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: 8px;
  grid-column: -1;
  justify-content: flex-start;
  /* justify-self: center; */
  align-self: end;
  /* min-width: 72px;
  max-width: 120px;
  width: auto; */
  width: 100%;
  height: 48px;
  padding: 0 16px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.criteria-row .remove-row:hover,
.criteria-row .remove-row:focus {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.55);
  color: #ffe4e6;
  outline: none;
}

.criteria-row .field input,
.criteria-row .field select {
  height: 48px;
  font-size: 16px;
}

.criteria-row .field input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.criteria-row .field input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.criteria-row .field input:focus {
  border-color: rgba(124, 58, 237, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.criteria-row .field select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.criteria-row .field select:hover {
  border-color: #a855f7;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.14);
}

.criteria-row .field select:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25), 0 8px 18px rgba(124, 58, 237, 0.14);
  background: #fff;
  color: #0f172a;
}

.criteria-row .field select option {
  color: #e5e7eb;
  background: rgba(12, 18, 36, 0.9);
}

.criteria-row .field select:focus option {
  background: #fff;
  color: #0f172a;
}

.previous-filters {
  gap: 10px;
  border-style: dashed;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-actions .status {
  color: #cbd5e1;
  font-weight: 600;
}

.form-actions .status.success {
  color: #a5f3fc;
}

.form-actions .status.error {
  color: #fecdd3;
}

.form-actions .status.warning {
  color: #fcd34d;
}

.form-actions .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .criteria-row {
    grid-template-columns: repeat(3, minmax(200px, 1fr)) 120px;
  }
}

@media (max-width: 640px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .criteria-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .criteria-row .remove-row {
    /* justify-self: center; */
    /* max-width: 120px; */
    width: 100%;
  }
}
