* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--white);
}

/* Layout */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-primary {
  background: #043cf7;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;

  font-weight: 500;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  opacity: 0.9;
}
a.btn-primary {
  color: #fff;
  text-decoration: none;
}

/* Selector bar */
.selector-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 0px;
  flex-shrink: 0;
}
.selector-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.selector-content select {
  appearance: none;
  background: #f3f4f6
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  background-size: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 32px 8px 12px;

  font-weight: 500;
  color: #111827;
  cursor: pointer;
}
.selector-content select:hover {
  background-color: #e5e7eb;
}
.divider {
  color: #9ca3af;
}
.badge {
  background: #d0eecd;
  color: #0c8059;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* Main layout */
.main-container {
  display: flex;
  flex: 1;
}
.sidebar {
  width: 256px;
  min-width: 256px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding-right: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left: 0px;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding: 0 12px;
}
.nav-item-dashboard {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;

  font-weight: 500;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.nav-item-dashboard:hover {
  background: #f3f4f6;
}
.nav-item-dashboard.active {
  background: #eff6ff;
  color: #1d4ed8;
}
.sidebar-cta {
  margin-top: 32px;
  background: #cdd8fd;
  padding: 16px;
  border-radius: 12px;
}
.sidebar-cta-title {
  font-weight: 500;
  color: #043cf7;
  margin-bottom: 8px;
}
.sidebar-cta-text {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 12px;
}
.sidebar-cta .btn-primary {
  width: 100%;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

/* Content area */
.content {
  flex: 1;
  padding-left: 24px;
  padding-right: 0px;
  padding-top: 24px;
  padding-bottom: 24px;
  background: var(--white);
}
.content-inner {
  max-width: 1200px;
}

/* Metric cards */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.metric-card:hover {
  border-color: #93c5fd;
}
.metric-card.active {
  border-color: #3b82f6;
  background: #eff6ff;
}
.metric-label {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.metric-value {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.metric-number {
  font-size: 28px;
  font-weight: 600;
  color: #111827;
}
.metric-change {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}
.metric-change.positive {
  background: #d0eecd;
  color: #14a807;
}
.metric-change.negative {
  background: #fedbe3;
  color: #fc4a74;
}

/* Chart container */
.chart-container {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}
.chart-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}
.chart-subtitle {
  color: #6b7280;
  margin-bottom: 24px;
}
.chart-area {
  height: 300px;
  position: relative;
}

/* Chart download buttons */
.chart-download-buttons {
  position: absolute;
  top: 16px;
  right: 16px;
  display: none;
  gap: 8px;
  z-index: 10;
}
.chart-container:hover .chart-download-buttons,
.bar-chart-container:hover .chart-download-buttons {
  display: flex;
}
.chart-download-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chart-download-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

/* Clipboard notification */
.clipboard-notification {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #111827;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;

  font-weight: 500;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideInUp 0.3s ease-out;
}
.clipboard-notification.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}
@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* SVG Chart */
.line-chart {
  width: 100%;
  height: 100%;
}
.grid-line {
  stroke: #e5e5e5;
  stroke-dasharray: 3 3;
}
.axis-line {
  stroke: #999;
}
.axis-text {
  font-size: 11px;
  fill: #666;
}
.data-line {
  fill: none;
  stroke-width: 2;
}
.data-point {
  stroke-width: 0;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  justify-content: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #374151;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Data table */
.data-table-container {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}
.table-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  border-bottom: 1px solid #e5e7eb;
}
.data-table th:not(:first-child) {
  text-align: right;
}
.data-table td {
  padding: 8px 16px;

  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.data-table td:not(:first-child) {
  text-align: right;
}
.data-table tr:hover {
  background: #f9fafb;
}
.fund-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fund-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Brand selector */
.brand-selector {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.brand-selector-title {
  font-weight: 500;
  color: #374151;
  margin-bottom: 12px;
}
.brand-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-btn {
  padding: 8px 12px;
  border-radius: 8px;

  font-weight: 500;
  border: none;
  cursor: pointer;
  background: #f3f4f6;
  color: #374151;
  transition: all 0.15s;
}
.brand-btn:hover {
  background: #e5e7eb;
}
.brand-btn.active {
  color: #fff;
}

/* Quarter selector */
.quarter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.quarter-btn {
  padding: 8px 16px;
  border-radius: 8px;

  font-weight: 500;
  border: none;
  cursor: pointer;
  background: #f3f4f6;
  color: #374151;
  transition: all 0.15s;
}
.quarter-btn:hover {
  background: #e5e7eb;
}
.quarter-btn.active {
  background: #043cf7;
  color: #fff;
}
.sample-size {
  font-size: 12px;
  color: #6b7280;
}

/* Bar chart grid */
.bar-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.bar-chart-container {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  position: relative;
}
.bar-chart-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}
.bar-chart-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 16px;
}
.bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.bar-label {
  width: 100px;
  font-size: 12px;
  color: #374151;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex: 1;
  height: 24px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}
.bar-value {
  font-size: 11px;
  font-weight: 500;
  color: #fff;
}

/* Snake chart */
.snake-chart {
  margin-top: 24px;
}
.snake-chart-svg {
  width: 100%;
  height: auto;
}
.snake-label {
  font-size: 13px;
  fill: #374151;
  font-weight: 500;
}
.snake-line {
  stroke-width: 2;
  opacity: 0.8;
}
.snake-dot {
  cursor: pointer;
}
.snake-dot:hover {
  r: 7;
}
.snake-value {
  font-size: 11px;
  fill: #666;
  font-weight: 500;
}

/* No data state */
.no-data {
  flex: 1;
  padding: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #f9fafb;
}
.no-data-content {
  max-width: 800px;
  width: 100%;
}
.no-data-card {
  text-align: center;
  padding: 48px;
  background: #fff;
  border: 2px dashed #93c5fd;
  border-radius: 16px;
  margin-bottom: 32px;
}
.no-data-icon {
  width: 64px;
  height: 64px;
  background: #cdd8fd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.no-data-title {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}
.no-data-market {
  font-size: 16px;
  color: #4b5563;
  margin-bottom: 8px;
}
.no-data-text {
  color: #6b7280;
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.no-data-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-outline {
  background: #fff;
  color: #374151;
  padding: 12px 24px;
  border-radius: 8px;

  font-weight: 500;
  border: 1px solid #d1d5db;
  cursor: pointer;
}
.btn-outline:hover {
  background: #f9fafb;
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  opacity: 0.4;
}
.skeleton-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}
.skeleton-line {
  background: #e5e7eb;
  border-radius: 4px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Mobile */
@media (max-width: 1024px) {
  .bar-charts-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  .metric-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .header-nav a {
    display: none;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 12px;
    z-index: 40;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
  }
  .mobile-nav select {
    width: 100%;
  }
  .content {
    padding-bottom: 80px;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 24px;
  }
  .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Fix selector bar to stay on one line */
  .selector-bar {
    padding: 8px 12px;
  }
  .selector-content {
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .selector-content select {
    font-size: 12px;
    padding: 6px 24px 6px 8px;
    min-width: 0;
    white-space: nowrap;
    background-size: 14px;
    background-position: right 4px center;
  }
  .divider {
    font-size: 12px;
    flex-shrink: 0;
  }
  .badge {
    font-size: 10px;
    padding: 3px 6px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Make tables horizontally scrollable */
  .data-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: calc(100vw - 70px);
  }
  .data-table {
    min-width: 600px;
  }
}
@media (min-width: 769px) {
  .mobile-nav {
    display: none;
  }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 540px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #6b7280;
  transition: all 0.2s ease;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

.modal-close svg {
  width: 24px;
  height: 24px;
}

.modal-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
  color: #1a1a1a;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #043cf7;
  box-shadow: 0 0 0 3px rgba(4, 60, 247, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9ca3af;
}

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

.form-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-primary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.btn-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  animation: spin 1s linear infinite;
}

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

/* Feedback notification */
.feedback-notification {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #111827;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideInUp 0.3s ease-out;
}

.feedback-notification.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

/* Responsive adjustments for feedback button */
@media (max-width: 768px) {
  .feedback-btn {
    display: none;
  }
}
