/* Utleiedata.no - Dashboard Styles */
/* Uses CSS variables from style.css (:root --navy, --accent, --border, etc.) */

/* ── Dashboard Layout ── */
.dashboard-header {
  padding-top: 7rem;
  padding-bottom: 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.dashboard-header p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.dashboard-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.data-freshness-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.freshness-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.stale-data-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #92400e;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.stale-data-banner svg {
  flex-shrink: 0;
  color: #d97706;
}

/* ── Breadcrumb (nav > a/span/svg pattern) ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Stats Cards ── */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

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

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: var(--shadow-md);
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent);
}

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

.stat-card-icon.teal {
  background: rgba(6, 182, 212, 0.08);
  color: var(--teal);
}

.stat-card-icon.success {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
}

.stat-card-icon.warning {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
}

.stat-card .stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-card .stat-card-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

.stat-card .stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
}

.stat-card .stat-card-change.positive {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
}

.stat-card .stat-card-change.negative {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* ── City Card Grid ── */
.city-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.city-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.city-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

.city-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.city-card:hover::after {
  opacity: 1;
}

.city-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.city-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.city-card-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.city-card:hover .city-card-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.city-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

a.city-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.city-card-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.city-card-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.city-card-stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.city-card-stat-label {
  color: var(--text-muted);
}

.city-card-footer {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.city-card-link {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: gap 0.2s ease;
}

.city-card:hover .city-card-link {
  gap: 0.625rem;
}

.city-card-link svg {
  width: 16px;
  height: 16px;
}

/* ── Chart Panels (used in templates) ── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.chart-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  overflow: hidden;
  min-width: 0;
}

.chart-panel:hover {
  box-shadow: var(--shadow-md);
}

.chart-panel-header {
  margin-bottom: 1rem;
}

.chart-panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-panel-header .chart-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.chart-panel-body {
  height: 300px;
  position: relative;
}

.chart-panel-body-wide {
  height: 360px;
}

.chart-panel-full {
  margin: 2rem 0;
}

.chart-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.chart-panel-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.chart-panel-empty p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ── Revenue Highlights ── */
.revenue-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.revenue-box {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.revenue-box:hover {
  box-shadow: var(--shadow-accent);
}

.revenue-box-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.5rem;
}

.revenue-box-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.revenue-box-note {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.375rem;
}

/* ── Dashboard Tables ── */
.dashboard-table-section {
  margin: 2rem 0;
}

.dashboard-table-section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.section-desc-inline {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table-responsive .dashboard-table {
  min-width: 500px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dashboard-table th {
  background: var(--surface);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.dashboard-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--surface-alt);
  color: var(--text-primary);
}

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

.dashboard-table tr:hover {
  background: var(--surface);
}

.listing-name-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Auth Pages ── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 6rem 1.5rem 3rem;
  background: var(--surface);
}

.auth-page .container {
  max-width: 440px;
  width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  color: var(--accent-hover);
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center;
  letter-spacing: -0.02em;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.auth-card .auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-card .auth-logo a {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.auth-card .auth-logo a span {
  color: var(--accent);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--white);
  color: var(--text-primary);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group .form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

.form-group .form-error {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.375rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.form-checkbox label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
}

.auth-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

.auth-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-link a:hover {
  color: var(--accent-hover);
}

.auth-error {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.auth-error svg {
  flex-shrink: 0;
}

.form-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.auth-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  text-align: center;
  line-height: 1.4;
}

/* ── Reports List ── */
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-list-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.report-list-item:hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: var(--shadow-md);
}

.report-list-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.report-list-item .report-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.reports-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.reports-empty svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.reports-empty h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.reports-empty p {
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ── Reports Extras ── */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-download:hover {
  color: var(--accent-hover);
}

.reports-cta {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.reports-cta p {
  margin-bottom: 0.75rem;
}

.empty-state-icon {
  margin-bottom: 1rem;
}

.empty-state-icon svg {
  color: var(--text-muted);
  opacity: 0.6;
}

.text-muted {
  color: var(--text-muted);
}

/* ── Upgrade Page ── */
.upgrade-container {
  max-width: 900px;
  margin: 0 auto;
}

.upgrade-current {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.upgrade-current p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.upgrade-current .tier-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.upgrade-current .tier-badge.free {
  background: var(--text-muted);
}

.upgrade-current .tier-badge.pro {
  background: var(--accent);
}

.upgrade-current .tier-badge.enterprise {
  background: var(--navy);
}

/* ── Filter / Toolbar ── */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.dashboard-toolbar .toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color 0.2s ease;
}

.filter-select:focus {
  border-color: var(--accent);
}

.search-input {
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  min-width: 220px;
  transition: border-color 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-size: 16px;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 2rem;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.04);
}

.pagination .active span {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  font-weight: 600;
}

.pagination .disabled span {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Alerts / Flash Messages ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.4;
}

.alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

/* ── Loading State ── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.loading-spinner::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

/* ── Responsive Dashboard ── */
@media (max-width: 1024px) {
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .revenue-highlights {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 768px) {
  .dashboard-page {
    overflow-x: hidden;
  }

  .stats-cards {
    grid-template-columns: 1fr;
  }

  .stats-cards-3 {
    grid-template-columns: 1fr;
  }

  .city-card-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    padding-top: 5rem;
    padding-bottom: 1.5rem;
  }

  .dashboard-header h1 {
    font-size: 1.375rem;
  }

  .dashboard-title {
    font-size: 1.375rem;
  }

  .dashboard-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-toolbar .toolbar-left,
  .dashboard-toolbar .toolbar-right {
    width: 100%;
  }

  .search-input {
    min-width: 100%;
  }

  .report-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .auth-page {
    padding-top: 5rem;
    padding-bottom: 2rem;
  }

  .auth-card {
    padding: 1.75rem;
  }

  .chart-panel {
    padding: 1rem;
  }

  .chart-panel-body {
    height: 240px;
  }

  .chart-panel-body-wide {
    height: 280px;
  }

  .chart-panel-full {
    margin: 1.25rem 0;
  }

  .dashboard-table-section {
    overflow-x: hidden;
  }

  .table-responsive {
    margin: 0 -1rem;
    padding: 0 1rem;
    border-radius: 8px;
  }

  .dashboard-table {
    font-size: 0.8125rem;
  }

  .dashboard-table th,
  .dashboard-table td {
    padding: 0.625rem 0.75rem;
    white-space: nowrap;
  }

  .listing-name-cell {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .paywall-overlay {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 1.25rem;
  }

  .city-card {
    padding: 1.5rem;
  }

  .revenue-box-value {
    font-size: 1.375rem;
  }

  .listing-name-cell {
    max-width: 140px;
  }
}


/* ── Legal Pages ── */
.legal-page {
  padding-top: 7rem;
  padding-bottom: 4rem;
}

.legal-container {
  max-width: 720px;
}

.legal-container h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
}

.legal-container h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-container p,
.legal-container li {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.legal-container ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-container li {
  margin-bottom: 0.4rem;
}

.legal-container a {
  color: var(--accent);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.legal-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-table code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}


/* ── Error Pages ── */
.error-page {
  padding-top: 10rem;
  padding-bottom: 6rem;
  text-align: center;
}

.error-container {
  max-width: 520px;
}

.error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.error-page p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.error-actions .btn {
  min-width: 140px;
}


/* ═══════════════════════════════════════════════════════════════════
   FREEMIUM GATING & PAYWALL STYLES
   ═══════════════════════════════════════════════════════════════════ */

/* ── Paywall Container (frosted glass overlay) ── */
.paywall-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.paywall-content-blur {
  filter: blur(8px);
  -webkit-filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.paywall-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10;
  padding: 2rem;
}

.paywall-lock-icon {
  width: 56px;
  height: 56px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1rem;
}

.paywall-headline {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.paywall-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 280px;
  line-height: 1.5;
}

.paywall-cta {
  margin-bottom: 0.5rem;
}

.paywall-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Real chart content rendered behind paywall blur */
.paywall-content-blur .chart-panel-body {
  min-height: 300px;
}

.paywall-content-blur .chart-panel-body-wide {
  min-height: 360px;
}

.paywall-content-blur canvas {
  min-height: 280px;
}

/* Placeholder content behind the blur — fake chart visuals */
.paywall-placeholder-chart {
  height: 300px;
  border-radius: 8px;
  background:
    /* Fake bar chart columns */
    linear-gradient(to top, #dbeafe 0%, #dbeafe 65%, transparent 65%) 10% 100% / 8% 100% no-repeat,
    linear-gradient(to top, #bfdbfe 0%, #bfdbfe 45%, transparent 45%) 22% 100% / 8% 100% no-repeat,
    linear-gradient(to top, #93c5fd 0%, #93c5fd 78%, transparent 78%) 34% 100% / 8% 100% no-repeat,
    linear-gradient(to top, #bfdbfe 0%, #bfdbfe 55%, transparent 55%) 46% 100% / 8% 100% no-repeat,
    linear-gradient(to top, #dbeafe 0%, #dbeafe 40%, transparent 40%) 58% 100% / 8% 100% no-repeat,
    linear-gradient(to top, #93c5fd 0%, #93c5fd 72%, transparent 72%) 70% 100% / 8% 100% no-repeat,
    linear-gradient(to top, #bfdbfe 0%, #bfdbfe 50%, transparent 50%) 82% 100% / 8% 100% no-repeat,
    linear-gradient(to bottom, var(--surface) 0%, #f0f5ff 100%);
}

.paywall-placeholder-chart-wide {
  height: 360px;
  background:
    /* Fake line chart wave */
    linear-gradient(to right, transparent 0%, transparent 5%, #dbeafe 5%, #dbeafe 5.5%, transparent 5.5%) 0 55% / 100% 2px no-repeat,
    linear-gradient(to right, transparent 0%, transparent 15%, #93c5fd 15%, #93c5fd 15.5%, transparent 15.5%) 0 40% / 100% 2px no-repeat,
    linear-gradient(to right, transparent 0%, transparent 25%, #dbeafe 25%, #dbeafe 25.5%, transparent 25.5%) 0 50% / 100% 2px no-repeat,
    linear-gradient(to right, transparent 0%, transparent 35%, #93c5fd 35%, #93c5fd 35.5%, transparent 35.5%) 0 35% / 100% 2px no-repeat,
    linear-gradient(to right, transparent 0%, transparent 50%, #bfdbfe 50%, #bfdbfe 50.5%, transparent 50.5%) 0 45% / 100% 2px no-repeat,
    linear-gradient(to right, transparent 0%, transparent 65%, #93c5fd 65%, #93c5fd 65.5%, transparent 65.5%) 0 30% / 100% 2px no-repeat,
    linear-gradient(to right, transparent 0%, transparent 80%, #dbeafe 80%, #dbeafe 80.5%, transparent 80.5%) 0 42% / 100% 2px no-repeat,
    /* Horizontal grid lines */
    repeating-linear-gradient(to bottom, transparent, transparent 59px, #e8f0fe 59px, #e8f0fe 60px),
    linear-gradient(to bottom, var(--surface) 0%, #f0f5ff 100%);
}


/* ── Locked Listing Rows ── */
.listing-row-locked td {
  color: var(--text-muted);
}

.listing-blocked-text {
  color: var(--text-muted);
  letter-spacing: 2px;
  font-size: 0.8rem;
  user-select: none;
}


/* ── Top 3 Unlock CTA Row ── */
.top3-unlock-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
}

.top3-unlock-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e40af;
}

.top3-unlock-cta svg {
  flex-shrink: 0;
  color: var(--accent);
}


/* ── Value Quantification Banner ── */
.value-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  border-radius: 12px;
  color: #fff;
}

.value-banner-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.value-banner-text {
  flex: 1;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.value-banner .btn {
  flex-shrink: 0;
  background: #fff;
  color: #1e40af;
  font-weight: 700;
}

.value-banner .btn:hover {
  background: #f0f4ff;
}


/* ── Tier Progress Indicator ── */
.tier-progress {
  margin-bottom: 1.5rem;
}

.tier-progress-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8125rem;
}

.tier-progress-label {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.tier-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  min-width: 80px;
}

.tier-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #06b6d4);
  border-radius: 100px;
  transition: width 0.6s ease;
}

.tier-progress-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.tier-progress-link:hover {
  color: var(--accent-hover);
}


/* ── Sticky Bottom Upgrade Banner ── */
.sticky-upgrade-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.sticky-upgrade-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.9375rem;
}

.sticky-upgrade-inner .btn {
  flex-shrink: 0;
}

.sticky-upgrade-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.sticky-upgrade-dismiss:hover {
  color: #fff;
}


/* ── Inline header (upgrade/reports pages without bg) ── */
.dashboard-header-inline {
  padding-top: 7rem;
}

/* ── Dashboard bottom padding for sticky banner ── */
.dashboard-page {
  padding-bottom: 4rem;
}

/* ── Nav user email ── */
.nav-user-email {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ── Pulsing Upgrade Button in Nav ── */
.nav-upgrade-pulse {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.8125rem;
  border-radius: 100px;
  text-decoration: none !important;
  animation: upgradePulse 2s ease-in-out infinite;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-upgrade-pulse:hover {
  background: var(--accent-hover);
  animation: none;
  transform: scale(1.05);
}

@keyframes upgradePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
  }
}


/* ── Mobile Upgrade Button (visible beside hamburger) ── */
.nav-mobile-upgrade {
  display: none;
  padding: 0.3rem 0.75rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .nav-mobile-upgrade {
    display: inline-flex;
    align-items: center;
  }
}

/* ── Small Button Variant ── */
.btn-sm {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
}


/* ── Upgrade Grid (upgrade.html) ── */
.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto 3rem;
}

.upgrade-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  transition: all 0.3s ease;
}

.upgrade-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: var(--shadow-md);
}

.upgrade-card-featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.upgrade-card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #06b6d4);
}

.upgrade-card-active {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.02);
}

.upgrade-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  white-space: nowrap;
}

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

.upgrade-tier-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.upgrade-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.upgrade-period {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.upgrade-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.upgrade-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.upgrade-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.upgrade-features li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--success);
  margin-top: 1px;
}

.upgrade-card .btn {
  width: 100%;
  justify-content: center;
}

.current-tier-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 2rem;
}

.current-tier-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.current-tier-value {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9375rem;
}


/* ── Cities CTA Banner (anonymous users) ── */
.cities-cta-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 10px;
  font-size: 0.875rem;
  color: #1e40af;
  font-weight: 500;
}

.cities-cta-banner svg {
  flex-shrink: 0;
  color: var(--accent);
}

.cities-cta-banner .btn {
  flex-shrink: 0;
  margin-left: auto;
}


/* ── Upgrade Trust Signals ── */
.upgrade-trust {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 0;
  flex-wrap: wrap;
}

.upgrade-trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.upgrade-trust-item svg {
  color: var(--success);
  flex-shrink: 0;
}


/* ── Responsive overrides for new components ── */
@media (max-width: 1024px) {
  .upgrade-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .value-banner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .tier-progress-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .tier-progress-bar {
    width: 100%;
  }

  .sticky-upgrade-inner {
    font-size: 0.8125rem;
    gap: 0.75rem;
  }

  .top3-unlock-cta {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .cities-cta-banner {
    flex-direction: column;
    text-align: center;
    gap: 0.625rem;
  }

  .cities-cta-banner .btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .upgrade-trust {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .sticky-upgrade-banner {
    padding: 0.375rem 0;
  }

  .sticky-upgrade-inner {
    font-size: 0.75rem;
    gap: 0.5rem;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .sticky-upgrade-inner .btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.6875rem;
  }

  .sticky-upgrade-dismiss {
    font-size: 1rem;
    padding: 0 0.125rem;
  }
}

@media (max-width: 480px) {
  .paywall-overlay {
    padding: 1.25rem;
  }

  .paywall-headline {
    font-size: 1rem;
  }

  .value-banner {
    padding: 1rem;
  }
}

/* ── Skeleton loading screens ── */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-alt, #f1f5f9);
  border-radius: 8px;
}

.skeleton::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%
  );
  animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-chart {
  height: 240px;
}

.skeleton-stat-value {
  height: 2rem;
  width: 60%;
  margin-bottom: 0.5rem;
}

.skeleton-stat-label {
  height: 1rem;
  width: 80%;
}

.skeleton-table-row {
  height: 1.25rem;
  width: 100%;
  margin-bottom: 0.75rem;
}

.skeleton-table-row:last-child {
  width: 70%;
}

/* Hide skeletons once content is loaded */
.chart-panel-body:not(:empty) + .skeleton-chart-wrapper,
.loaded .skeleton-chart-wrapper {
  display: none;
}
