:root {
  color-scheme: light;
  --bg: #efeff7;
  --bg-deep: #efeef7;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: #d1d4e6;
  --text: #1d1d1d;
  --muted: #5b5959;
  --accent: #5260c4;
  --accent-deep: #6a52c4;
  --accent-dark: #2a3b8c;
  --ink-soft: #272b41;
  --lavender: #8f52c4;
  --shadow: 0 24px 60px rgba(39, 43, 65, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(82, 96, 196, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(143, 82, 196, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
}

.app-shell {
  width: min(1580px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  margin-bottom: 22px;
}

.stat-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: var(--accent-dark);
}

h1,
h3,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.05;
  font-weight: 800;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.4rem;
  font-weight: 700;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 700;
}

.hero-copy,
.muted,
label span,
.file-status {
  color: var(--muted);
}

.hero-copy {
  max-width: 56ch;
  font-size: 1rem;
  line-height: 1.5;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(209, 212, 230, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.upload-panel,
.controls-panel,
.results-panel {
  padding: 24px;
  margin-bottom: 22px;
}

.upload-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.data-source-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.data-source-controls__field {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
  flex: 1 1 280px;
}

.data-source-controls__field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.data-source-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.data-source-status__bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(82, 96, 196, 0.14);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(82, 96, 196, 0.1), rgba(143, 82, 196, 0.08));
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
}

.data-source-status__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.file-status {
  margin-top: 14px;
}

.cache-status {
  margin-top: 8px;
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--accent-dark);
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.secondary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary-button:not(:disabled):hover {
  border-color: var(--accent);
}

.secondary-button.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(82, 96, 196, 0.16), rgba(143, 82, 196, 0.1));
}

.date-preset-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 18px;
}

.property-filter {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(209, 212, 230, 0.9);
}

.property-filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

.property-filter-toggle::-webkit-details-marker {
  display: none;
}

.property-filter-toggle::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.property-filter[open] .property-filter-toggle::after {
  content: "-";
}

.property-filter-content {
  margin-top: 14px;
}

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

.property-filter-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
}

.property-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.property-pill input {
  margin: 0;
  accent-color: var(--accent-deep);
}

.property-pill.is-unselected {
  opacity: 0.55;
  background: rgba(239, 238, 247, 0.5);
}

.pill-count {
  color: var(--muted);
  font-weight: 600;
}

.dashboard-tabs {
  margin-bottom: 22px;
}

.tab-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.tab-button:hover {
  border-color: var(--accent);
}

.tab-button.is-active {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #ffffff;
  border-color: transparent;
}

.tab-panel[hidden] {
  display: none;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.stacked-insights {
  display: grid;
  gap: 18px;
}

.filters-grid,
.stats-grid {
  display: grid;
  gap: 16px;
}

.filters-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 18px;
}

.filter-section + .filter-section {
  margin-top: 18px;
}

.filter-section--secondary {
  padding-top: 18px;
  border-top: 1px solid rgba(209, 212, 230, 0.75);
}

.filter-section__label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.filters-grid--dates,
.filters-grid--failed {
  margin-top: 12px;
}

label {
  display: grid;
  gap: 8px;
}

.toggle-field {
  display: flex;
  align-items: end;
}

.switch-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  align-self: end;
  min-height: 50px;
}

.switch-field span:last-child {
  color: var(--text);
  font-weight: 500;
}

.switch-field input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d1d4e6;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(39, 43, 65, 0.2);
  transition: transform 0.2s ease;
}

.switch-field input[type="checkbox"]:checked + .switch-slider {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.switch-field input[type="checkbox"]:checked + .switch-slider::after {
  transform: translateX(20px);
}

select {
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  font: inherit;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  font: inherit;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

select:focus,
input[type="number"]:focus {
  outline: 2px solid rgba(106, 82, 196, 0.26);
  outline-offset: 2px;
  border-color: var(--accent);
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.95fr);
  gap: 18px;
  margin-bottom: 22px;
}

.overview-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.overview-toolbar__control {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.overview-toolbar__control span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

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

.stat-card {
  padding: 20px 22px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 238, 247, 0.9));
}

.stat-card--wide {
  grid-column: 1 / -1;
}

.stat-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
}

.info-tooltip__trigger {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(82, 96, 196, 0.28);
  border-radius: 50%;
  background: rgba(82, 96, 196, 0.08);
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: help;
  padding: 0;
}

.info-tooltip__content {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(260px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(39, 43, 65, 0.96);
  color: #ffffff;
  font-size: 0.8rem;
  line-height: 1.4;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: 0 18px 40px rgba(39, 43, 65, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
  z-index: 30;
}

.info-tooltip__content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(39, 43, 65, 0.96) transparent transparent transparent;
}

.info-tooltip:hover .info-tooltip__content,
.info-tooltip:focus-within .info-tooltip__content {
  opacity: 1;
  visibility: visible;
}

.info-tooltip--align-right .info-tooltip__content {
  left: auto;
  right: 0;
  transform: none;
}

.info-tooltip--align-right .info-tooltip__content::after {
  left: auto;
  right: 12px;
  transform: none;
}

.info-tooltip--below .info-tooltip__content {
  bottom: auto;
  top: calc(100% + 10px);
}

.info-tooltip--below .info-tooltip__content::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent rgba(39, 43, 65, 0.96) transparent;
}

.stat-value {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 700;
  color: var(--ink-soft);
}

.stat-card--success {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 12px;
  min-height: 100%;
  padding-bottom: 18px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.98), rgba(239, 238, 247, 0.92) 62%),
    linear-gradient(180deg, rgba(82, 96, 196, 0.12), rgba(143, 82, 196, 0.08));
}

.success-dial {
  width: min(220px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.success-dial__ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(
      from -90deg,
      #58d699 0turn,
      #66dca0 calc(var(--dial-progress) * 1turn),
      #f05d5e calc(var(--dial-progress) * 1turn),
      #e5484d 1turn
    );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    0 18px 40px rgba(39, 43, 65, 0.12);
  padding: 18px;
  position: relative;
}

.success-dial__ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 61%, rgba(255, 255, 255, 0.26) 61.5%, rgba(255, 255, 255, 0.26) 66%, transparent 66.5%);
  pointer-events: none;
}

.success-dial__center {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.98), rgba(246, 245, 252, 0.92));
  border: 1px solid rgba(209, 212, 230, 0.7);
}

.stat-value--dial {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 3.5rem);
}

.success-legend {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 220px;
}

.success-legend__item {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.success-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.success-legend__swatch--success {
  background: linear-gradient(180deg, #6ce0a6 0%, #53c88f 100%);
}

.success-legend__swatch--failed {
  background: linear-gradient(180deg, #f36e6e 0%, #df4a4e 100%);
}

.stat-card > .muted:last-child {
  margin-bottom: 0;
}

.results-header {
  margin-bottom: 18px;
}

.results-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  margin-bottom: 18px;
}

.results-toggle::-webkit-details-marker {
  display: none;
}

.results-toggle::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-dark);
  flex-shrink: 0;
}

.results-panel[open] .results-toggle::after {
  content: "-";
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 18px;
  border: 1px solid rgba(209, 212, 230, 0.9);
  background: rgba(255, 255, 255, 0.88);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(209, 212, 230, 0.72);
  text-align: left;
  vertical-align: top;
}

th {
  position: relative;
  background: linear-gradient(180deg, rgba(82, 96, 196, 0.12), rgba(143, 82, 196, 0.08));
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: rgba(239, 238, 247, 0.5);
}

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

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 28px 16px;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 28px;
  }

  .upload-header {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-panel,
  .controls-panel,
  .results-panel,
  .stat-card {
    padding: 18px;
  }

  .stats-layout,
  .stats-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .success-dial {
    width: min(190px, 100%);
  }

  h1 {
    font-size: 1.85rem;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
