html,
body {
  height: 100%;
  background: #ffffff;
}
body {
  margin: 0;
  padding: 0;
}

/* ----------ROAS (Global)----------*/

#roas-app {
  --bg: #f7f7fb;
  --panel: #ffffff;
  --muted: #667085; /* helper text */
  --text: #111827; /* near-black */
  --accent: #3b82f6; /* gentle blue */
  --accent-600: #2563eb;
  --accent-700: #1d4ed8;
  --border: #e5e7eb; /* soft border */
  --hover: #f2f4f7; /* subtle hover */
  --shadow: 0 4px 18px rgba(16, 24, 40, 0.08);

  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;

  display: grid;
  grid-template-columns: 220px 1fr;
}

/* ----------Sidebar (dark banner)----------*/

.roas-sidebar {
  background: linear-gradient(180deg, #0f172a, #111827);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
}

.roas-brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  margin-left: 10px;
  font-size: 25px;

  /* Gradient text color */
  background: linear-gradient(90deg, #60a5fa 0%, #a78bfa 60%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.roas-nav {
  display: grid;
}
.roas-navlink {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #e5e7eb;
  text-decoration: none;
  border: 1px solid transparent;
  font-size: 18px;
}
.roas-navlink:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.roas-navlink.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ----------Main + Search Bar----------*/

.roas-main {
  padding: 24px 28px;
}
.roas-header {
  display: flex;
  margin-bottom: 16px;
}

.roas-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  font-size: 16px;
}

.roas-input {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  outline: none;
  min-width: 300px; /* longer search bar */
  font-size: 16px;
  box-shadow: none;
}
.roas-input:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* Date range pickers */
.roas-input[type="date"] {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  outline: none;
  font-size: 16px;
  width: 140px;
}

.roas-search .dash {
  align-self: center;
  color: var(--muted);
}

.roas-btn {
  background: var(--accent);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.roas-btn:hover {
  filter: brightness(1.03);
}

.roas-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: #111827;
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  box-shadow: none;
}
.roas-btn-secondary:hover {
  background: var(--hover);
}

/* Push Reset to far right */
.roas-reset {
  margin-left: auto;
}

.hint {
  color: var(--muted);
  font-size: 14px;
  margin-left: 4px;
  margin-right: 6px;
}

/* ----------Searchable Multi-select Dropdown (Markets)----------*/

.roas-dd {
  position: relative;
}

.roas-dd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.roas-dd-toggle:focus {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
}

.roas-dd-label {
  opacity: 0.85;
}
.roas-dd-count {
  opacity: 0.7;
  font-size: 12px;
}

.roas-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: 320px;
  max-height: 320px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
}
.roas-dd.open .roas-dd-menu {
  display: block;
}

.roas-dd-search {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.roas-dd-search input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  outline: none;
  font-size: 16px;
}
.roas-dd-search input:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.roas-dd-list {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
}
.roas-dd-list li {
  margin: 2px 0;
}
.roas-dd-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}
.roas-dd-list label:hover {
  background: var(--hover);
}
.roas-dd-list input[type="checkbox"] {
  accent-color: var(--accent);
}

/* ----------Cards, Tables, Grids----------*/

.roas-section {
}

.roas-h1 {
  font-size: 30px;
  margin: 20px 0 20px;
  color: #101828;
}

.roas-track {
  font-size: 30px;
  margin: 0;
  color: #101828;
}

.roas-artist {
  font-size: 20px;
  font-style: italic;
  color: #5d6473; /* muted gray for secondary info */
  margin: 2px 0 10px; /* very little gap above, small gap below */
}

.roas-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

/* Table wrapper */
.roas-table-wrap {
  overflow: auto;
}

/* Table */
.roas-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

/* Livelier header band */
.roas-table thead th {
  background: #eff6ff; /* soft blue */
  color: #1e3a8a; /* deep blue text */
  font-weight: 600;
  border-bottom: 1px solid #dbeafe;
}

/* Body cells */
.roas-table th,
.roas-table td {
  padding: 14px 12px;
  text-align: left;
  font-size: 16px;
  color: #111827;
  border-bottom: 1px solid var(--border);
}

.roas-table tbody tr:nth-child(odd) {
  background: #fcfdff;
}

.roas-table tbody tr:hover {
  background: #f1f5ff;
  cursor: pointer;
}

.roas-linklike {
  color: var(--accent-600);
}
.roas-linklike:hover {
  color: var(--accent-700);
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 20px 8px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  color: #0f172a;
}

/* Responsive cards grid */
.roas-grid3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 1000px) {
  .roas-grid3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.roas-kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.roas-kv span {
  color: var(--muted);
}
.muted {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

/* ----------Sortable table indicators----------*/
.roas-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  white-space: nowrap;
}
.roas-table th .sort-indicator {
  display: inline-block;
  width: 1ch;
  margin-left: 6px;
  opacity: 0.65;
  color: #475467;
}
.roas-table th.sortable[data-sort="none"] .sort-indicator::after {
  content: "↕";
  font-size: 12px;
  opacity: 0.45;
}
.roas-table th.sortable[data-sort="asc"] .sort-indicator::after {
  content: "▲";
  font-size: 11px;
}
.roas-table th.sortable[data-sort="desc"] .sort-indicator::after {
  content: "▼";
  font-size: 11px;
}

/* No color highlight for active sorted column */
.roas-table th.sortable.active,
.roas-table td.sorted {
  color: inherit; /* keep normal text color */
}

/* Campaign status dot */
.status-dot {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.status-active {
  background-color: green;
}
.status-paused {
  background-color: red;
}
.status-completed {
  background-color: blue;
}

/* Campaign info block */
.roas-submeta {
  font-size: 15px;
  line-height: 1; /* tighter line spacing */
  margin-bottom: 16px;
}
.roas-submeta div {
  margin: 2px 0;
}

.roas-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.roas-title-block {
  flex: 1;
  margin-right: 20px;
}

/* DiD box — brand gradient */
.roas-did-box {
  min-width: 180px;
  text-align: center;
  padding: 12px 16px;
  border-radius: 12px;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.18);
  border: 0;
  margin-bottom: 20px;
}

/* Color themes */
.roas-did-box.positive {
  background: linear-gradient(90deg, #065f46 0%, #047857 100%);
}

.roas-did-box.negative {
  background: linear-gradient(90deg, #991b1b 0%, #dc2626 100%);
}

.roas-did-box .did-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.roas-did-box .did-star {
  margin-left: 4px;
  font-size: 18px;
  vertical-align: super;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.roas-did-box .did-label {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 6px;
}

/* Blurb box */
.roas-blurb .blurb-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 2px;
}

/* Chart card */
.roas-chart-card {
  height: 360px;
  margin-top: 12px;
}

/* Platform Metric Timeseries */
.platform-title {
  margin: 0 0 8px;
  text-align: center;
  font-weight: 700;
}
.roas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 1000px) {
  .roas-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  height: 260px;
}
.metric-card h4 {
  margin: 0 0 6px;
  font-weight: 600;
  color: #111827;
}
.metric-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0 4px;
}

.archive-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.archive-content {
  background: white;
  padding: 2rem;
  max-width: 1000px;
  width: 90%;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  font-family: sans-serif;
  animation: fadeInScale 0.3s ease;
}
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.archive-content h2 {
  margin-top: 0;
}

.archive-content button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: #333;
  color: white;
  cursor: pointer;
}
