body {
  font-family: "HelveticaNeue-Cond", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f5f5f2;
  min-height: 100vh;
}

.topbar {
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: white;
  padding: 0;
  font-size: 1.5rem;
  display: flex;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tab-button {
  flex: 1;
  padding: 1rem 0;
  text-align: center;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  color: white;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tab-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.tab-button:hover::before {
  left: 100%;
}

.tab-button:hover {
  background-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.tab-button.active {
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 100%);
  color: white;
  font-weight: bold;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo {
  width: 140px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.container {
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.charts {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.chart-box {
  width: 100%;
  /* Fjernet max-width for at matche bredden af Top 10 Mæglere table */
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}

.chart-title-bar {
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: white;
  padding: 1rem 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Chip-dropdown til de olivenfarvede bjælker: gennemsigtig hvid + hvid tekst/pil */
.chart-dropdown {
  padding: 0.5rem 2.1rem 0.5rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2l4.5 4 4.5-4'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
  background-size: 11px;
  color: white;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  min-width: 140px;
  text-align: left;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.chart-dropdown:hover {
  background-color: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.6);
}

.chart-dropdown:focus {
  outline: none;
  border-color: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 3px rgba(228,167,41,0.55);
}

/* Selve listen kan kun delvist styles (OS-styret), men sæt læsbare farver */
.chart-dropdown optgroup {
  background-color: #f8f9fa;
  color: #2c3e50;
  font-weight: 700;
  font-size: 0.85rem;
  font-style: normal;
}

.chart-dropdown option {
  background-color: #fff;
  color: #2c3e50;
  font-weight: 400;
}

/* Periode-dropdown skal matche område-dropdownen på bjælken: samme chip-stil OG samme bredde */
#timebaseSelect.chart-dropdown,
#kommuneTimebaseSelect.chart-dropdown {
  width: auto !important;
  min-width: 140px !important;
  padding: 0.5rem 2.1rem 0.5rem 0.9rem !important;
  font-size: 0.85rem !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  background: rgba(255,255,255,0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2l4.5 4 4.5-4'/%3E%3C/svg%3E") no-repeat right 0.85rem center !important;
  background-size: 11px !important;
}

#timebaseSelect.chart-dropdown:hover,
#kommuneTimebaseSelect.chart-dropdown:hover {
  border-color: rgba(255,255,255,0.6) !important;
  background-color: rgba(255,255,255,0.22) !important;
}

#timebaseSelect.chart-dropdown:focus,
#kommuneTimebaseSelect.chart-dropdown:focus {
  border-color: rgba(255,255,255,0.85) !important;
  box-shadow: 0 0 0 3px rgba(228,167,41,0.55) !important;
  outline: none !important;
}

.chart-title-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100px); }
  100% { transform: translateX(calc(900px + 100px)); }
}

canvas {
  width: 100% !important;
  height: 400px !important;
  padding: 1rem;
}

/* HTML Legend Styling - Bedre til iOS touch */
#legend-container {
  padding: 1rem;
  margin-top: 0.5rem;
}

.chart-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.2s ease;
  min-height: 44px; /* iOS anbefalet touch target størrelse */
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chart-legend-item:hover,
.chart-legend-item:active {
  background: #e9ecef;
  transform: scale(1.05);
}

.legend-color-box {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
}

.legend-text {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Mobile specific styling */
@media (max-width: 768px) {
  .chart-legend-list {
    gap: 0.5rem;
  }

  .chart-legend-item {
    padding: 0.6rem 0.8rem;
    font-size: 11px;
  }

  .legend-color-box {
    width: 10px;
    height: 10px;
  }

  .legend-text {
    font-size: 11px;
  }
}

.styled-table-container {
  margin-bottom: 2rem;
  overflow-x: auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
  transition: transform 0.3s ease;
}

.styled-table-container:hover {
  transform: translateY(-2px);
}

.styled-table-container table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  min-width: 700px;
}

.styled-table-container th,
.styled-table-container td {
  border: none;
  border-bottom: 1px solid #eee;
  padding: 1rem;
  text-align: left;
  white-space: normal;
  line-height: 1.4;
  transition: background-color 0.2s ease;
}

.styled-table-container tbody tr:hover {
  background-color: #f8f9fa;
}

.styled-table-container th {
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
}

.styled-table-container tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* Styling til ændringsindikatorer */
.change-indicator {
  margin-left: 8px;
  font-weight: bold;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  white-space: nowrap;
}

.change-indicator.positive {
  color: #27ae60;
  background: rgba(39, 174, 96, 0.1);
  border: 1px solid rgba(39, 174, 96, 0.2);
}

.change-indicator.negative {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.change-indicator .arrow {
  margin-right: 3px;
  font-size: 1rem;
}

/* Animationer for ændringsindikatorer */
.change-indicator {
  animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Forbedret styling af celler med ændringer */
.styled-table-container td div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.styled-table-container td div span:first-child {
  flex-grow: 1;
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.tab-content.active {
  display: block;
}

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

/* Controls wrapper for multiple dropdowns */
.controls-wrapper {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  padding: 0.9rem 1.5rem;
  border-radius: 16px 16px 0 0;
}

/* Titel til venstre + dropdown-gruppe til højre (matcher de øvrige olivenbjælker) */
.controls-title {
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
}
.controls-title .ico {
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.5rem;
  color: #fff;
}
.controls-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Dropdowns i Top 10-bjælken får samme chip-stil som de øvrige olivenbjælker */
.controls-wrapper .dropdown-wrapper {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
}
.controls-wrapper #postnummerSelect,
.controls-wrapper #changeIntervalSelect,
.controls-wrapper #maeglerhusetChangeIntervalSelect {
  width: auto;
  min-width: 150px;
  padding: 0.5rem 2.1rem 0.5rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2l4.5 4 4.5-4'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
  background-size: 11px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.controls-wrapper #postnummerSelect:hover,
.controls-wrapper #changeIntervalSelect:hover,
.controls-wrapper #maeglerhusetChangeIntervalSelect:hover {
  background-color: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.6);
}
.controls-wrapper #postnummerSelect:focus,
.controls-wrapper #changeIntervalSelect:focus,
.controls-wrapper #maeglerhusetChangeIntervalSelect:focus {
  outline: none;
  border-color: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 3px rgba(228,167,41,0.55);
}
.controls-wrapper #postnummerSelect option,
.controls-wrapper #changeIntervalSelect option,
.controls-wrapper #maeglerhusetChangeIntervalSelect option {
  background: #fff;
  color: #2c3e50;
}

.dropdown-wrapper {
  margin-bottom: 0;
  max-width: 250px;
  min-width: 200px;
  flex: 1;
}

.dropdown-wrapper select {
  width: 100%;
}

#postnummerSelect,
#timebaseSelect,
#facebookSelect,
#changeIntervalSelect,
#maeglerhusetChangeIntervalSelect {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 0.95rem;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid #d8dcd5;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-weight: 600;
  color: #575c4f;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23575c4f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2l4.5 4 4.5-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 11px;
}

#postnummerSelect:hover,
#timebaseSelect:hover,
#facebookSelect:hover,
#changeIntervalSelect:hover,
#maeglerhusetChangeIntervalSelect:hover {
  border-color: #c2c7bd;
}

#postnummerSelect:focus,
#timebaseSelect:focus,
#facebookSelect:focus,
#changeIntervalSelect:focus,
#maeglerhusetChangeIntervalSelect:focus {
  outline: none;
  border-color: #e4a729;
  box-shadow: 0 0 0 3px rgba(228, 167, 41, 0.25);
}

#postnummerSelect option,
#timebaseSelect option,
#facebookSelect option,
#changeIntervalSelect option,
#maeglerhusetChangeIntervalSelect option {
  background: white;
  color: #575c4f;
  padding: 0.5rem;
  font-weight: 500;
}

/* Enhanced styling for table rank column */
.styled-table-container td:first-child {
  font-weight: bold;
}

.styled-table-container td img {
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Facebook/SoMe specific styles - OPDATERET FOR 6 KORT PÅ ÉN RÆKKE */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  padding: 1.2rem 0.8rem;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e4a729, #f5c842, #e4a729);
  background-size: 200% 100%;
  animation: gradientMove 3s ease-in-out infinite;
}

@keyframes gradientMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.15);
  border-color: #e4a729;
}

.stat-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #575c4f;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  line-height: 1;
}

.stat-title {
  color: #666;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.stat-trend {
  color: #e4a729;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
  line-height: 1;
}

.posts-container {
  margin: 2rem 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
  overflow: hidden;
}

.posts-container h3 {
  color: white;
  margin: 0;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  font-size: 1.3rem;
  font-weight: 600;
}

.posts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.posts-table th,
.posts-table td {
  border: none;
  border-bottom: 1px solid #eee;
  padding: 1rem;
  text-align: left;
}

.posts-table th {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  color: #575c4f;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
}

.posts-table tbody tr:hover {
  background-color: #f8f9fa;
}

.posts-table a {
  color: #e4a729;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.posts-table a:hover {
  color: #c8941f;
  text-decoration: underline;
}

.last-updated {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-top: 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  font-weight: 500;
}

.loading-spinner {
  text-align: center;
  padding: 3rem;
  font-size: 1.2rem;
  color: #666;
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
}

.error-container {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
  border: 2px solid #e74c3c;
}

.error-container h3 {
  color: #e74c3c;
  margin-bottom: 1rem;
}

.error-container p {
  color: #666;
  margin-bottom: 2rem;
}

/* ============================================ */
/* MOBILE OPTIMIZATION STYLES */
/* ============================================ */

/* Mobile Summary Widget */
.mobile-summary-widget {
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 100%);
  color: white;
  border-radius: 16px;
  padding: 16px;
  margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(228, 167, 41, 0.3);
}

.summary-date {
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.9;
  margin-bottom: 12px;
}

.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.summary-stats-compact {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.summary-stat {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 8px;
  backdrop-filter: blur(10px);
}

.summary-stat-compact {
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 6px;
  backdrop-filter: blur(10px);
}

.summary-stat .stat-value,
.summary-stat-compact .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 4px;
}

.summary-stat-compact .stat-value {
  font-size: 1.2rem;
  margin-bottom: 3px;
}

.summary-stat .stat-change,
.summary-stat-compact .stat-change {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.summary-stat-compact .stat-change {
  font-size: 0.7rem;
  margin-bottom: 3px;
}

.summary-stat .stat-change.positive,
.summary-stat-compact .stat-change.positive { 
  color: #c8f7c5; 
}

.summary-stat .stat-change.negative,
.summary-stat-compact .stat-change.negative { 
  color: #e74c3c; 
}

.summary-stat .stat-change.neutral,
.summary-stat-compact .stat-change.neutral { 
  color: rgba(255, 255, 255, 0.7); 
}

.summary-stat .stat-label,
.summary-stat-compact .stat-label {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-stat-compact .stat-label {
  font-size: 0.65rem;
  line-height: 1;
}

/* Mobile Agent Cards */
.agents-cards {
  display: none;
}

.agent-card-compact {
  background: white;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  border-left: 3px solid #e4a729;
  margin-bottom: 6px;
}

.agent-header-single-line {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 6px;
}

.agent-logo {
  width: 20px;
  height: 20px;
  background: #e9ecef;
  border-radius: 4px;
  flex-shrink: 0;
}

.agent-name-single {
  font-weight: 600;
  color: #575c4f;
  font-size: 0.8rem;
  line-height: 1.1;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-rating-inline {
  font-size: 0.75rem;
  color: #e4a729;
  font-weight: bold;
  flex-shrink: 0;
  white-space: nowrap;
}

.agent-stats-compact {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px;
}

.agent-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.75rem;
  text-align: center;
}

.agent-stat:last-child {
  border-bottom: none;
}

.agent-stat-label {
  color: #666;
  font-weight: 500;
  font-size: 0.65rem;
  margin-bottom: 2px;
  line-height: 1;
}

.agent-stat-value {
  font-weight: 600;
  color: #575c4f;
  font-size: 0.75rem;
  line-height: 1.1;
}

/* Time period dropdown */
.time-period-select {
  width: 100%;
  padding: 0.85rem 2.8rem 0.85rem 1.2rem;
  border-radius: 12px;
  border: 2px solid #e1e5e9;
  font-size: 0.95rem;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-weight: 600;
  color: #575c4f;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23575c4f' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 14px;
}

.time-period-select:hover,
.time-period-select:focus {
  border-color: #e4a729;
  outline: none;
  box-shadow: 0 4px 16px rgba(228, 167, 41, 0.25);
  transform: translateY(-1px);
  background: linear-gradient(135deg, #fffaf0 0%, #fff8e7 100%);
}

.time-period-select option {
  background: white;
  color: #575c4f;
  padding: 0.5rem;
  font-weight: 500;
}

/* Responsive design */
@media (max-width: 1200px) {
  .stats-container {
    grid-template-columns: repeat(3, 1fr);
    max-width: 800px;
  }
  
  .summary-stats-compact {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
  }
  
  .summary-stats-compact {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  /* Hide desktop tables, show mobile cards (but NOT admin tables or vejen-metrics tables) */
  .styled-table-container table:not(.admin-table):not(.vejen-metrics-table) {
    display: none;
  }
  
  .agents-cards {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 1rem;
  }
  
  /* Show mobile summary widget only on mobile */
  .mobile-summary-widget {
    display: block !important;
  }
  
  /* Show time period dropdown only on mobile */
  .time-period-select,
  .mobile-only-dropdown {
    display: block !important;
  }
  
  .container {
    padding: 1rem;
  }
  
  .chart-box {
    max-width: 100%;
  }
  
  .chart-box canvas {
    height: 450px !important; /* Øget fra 250px for bedre legend click targets */
  }
  
  .chart-title-bar {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    font-size: 1.1rem;
  }
  
  .chart-controls {
    justify-content: center;
  }
  
  .topbar {
    font-size: 1.1rem;
  }
  
  .tab-button {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }
  
  .logo {
    width: 120px;
  }
  
  .controls-wrapper {
    flex-direction: column;
  }

  .dropdown-wrapper {
    max-width: 100%;
    min-width: 100%;
  }

  .dropdown-wrapper.interval-dropdown {
    margin-left: 0;
  }
  
  .stats-container {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    max-width: 100%;
  }
  
  .stat-card {
    padding: 1rem 0.6rem;
    min-height: 120px;
  }
  
  .stat-value {
    font-size: 1.6rem;
  }
  
  .stat-icon {
    font-size: 1.8rem;
  }
  
  .stat-title {
    font-size: 0.75rem;
  }
  
  .stat-trend {
    font-size: 0.7rem;
  }
  
  /* Posts table mobile optimization */
  .posts-table {
    font-size: 0.8rem;
    display: none; /* Hide desktop table on mobile */
  }
  
  .posts-table th,
  .posts-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .posts-container h3 {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
  }

  /* Mobile posts cards */
  .posts-mobile-cards {
    display: block;
    padding: 15px;
    gap: 12px;
  }

  .post-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border-left: 3px solid #e4a729;
  }

  .post-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
  }

  .post-title {
    font-weight: 600;
    color: #575c4f;
    font-size: 0.85rem;
    line-height: 1.2;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .post-date {
    font-size: 0.75rem;
    color: #666;
    flex-shrink: 0;
  }

  .post-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .post-stat {
    text-align: center;
    padding: 6px 4px;
    background: #f8f9fa;
    border-radius: 6px;
  }

  .post-stat-value {
    display: block;
    font-weight: 600;
    color: #575c4f;
    font-size: 0.8rem;
    line-height: 1;
    margin-bottom: 2px;
  }

  .post-stat-label {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .post-link {
    text-align: center;
    margin-top: 8px;
  }

  .post-link a {
    color: #e4a729;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 12px;
    border: 1px solid #e4a729;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
  }

  .post-link a:hover {
    background: #e4a729;
    color: white;
  }

  /* Mobile Posts Optimization */
  .posts-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .posts-table thead,
  .posts-table tbody,
  .posts-table th,
  .posts-table td,
  .posts-table tr {
    display: block;
  }
  
  .posts-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .posts-table tr {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 8px;
  }
  
  .posts-table td {
    border: none !important;
    padding: 4px 0;
    text-align: left !important;
    white-space: normal;
    font-size: 0.75rem;
  }
  
  .posts-table td:before {
    content: attr(data-label) ": ";
    font-weight: bold;
    color: #575c4f;
    display: inline;
  }
  
  .summary-stats-compact {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  .change-indicator {
    font-size: 0.75rem;
    padding: 1px 4px;
    margin-left: 4px;
  }
  
  .styled-table-container td div {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .styled-table-container {
    position: relative;
  }

  .styled-table-container::after {
    content: '← Swipe for mere →';
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.7rem;
    color: #999;
    opacity: 0.7;
    pointer-events: none;
  }
  
  .loading-spinner {
    padding: 2rem 1rem;
    font-size: 1rem;
  }
  
  .error-container {
    padding: 2rem 1rem;
  }
  
  .error-container h3 {
    font-size: 1.2rem;
  }
  
  .error-container p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  
  .stat-card {
    padding: 0.8rem 0.4rem;
    min-height: 100px;
  }
  
  .stat-value {
    font-size: 1.4rem;
  }
  
  .stat-icon {
    font-size: 1.5rem;
  }
  
  .stat-title {
    font-size: 0.7rem;
  }
  
  .tab-button {
    font-size: 0.8rem;
    padding: 0.6rem 0.25rem;
  }

  .chart-box canvas {
    height: 400px !important; /* Øget fra 200px for bedre legend click targets */
  }

  .summary-stats-compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .change-indicator {
    font-size: 0.7rem;
    padding: 1px 3px;
  }

  .styled-table-container table {
    min-width: 600px;
  }

  /* Tools dropdown mobile styling */
  .dropdown-arrow {
    display: none; /* Skjul dropdown pil på mobil */
  }

  .tools-dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    font-size: 0.85rem;
  }

  .tools-dropdown-item {
    padding: 12px 16px;
    font-size: 0.85rem;
  }

  .tools-parent-tab {
    font-size: 0.8rem;
  }
}

/* Desktop - vis normal posts table */
@media (min-width: 769px) {
  .agents-cards {
    display: none !important;
  }

  .mobile-summary-widget {
    display: none;
  }

  .posts-mobile-cards {
    display: none;
  }

  .posts-table {
    display: table !important;
  }
}

/* ============================================ */
/* ADMIN DASHBOARD STYLES */
/* ============================================ */

/* Admin Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e4a729, #f5c842, #e4a729);
  background-size: 200% 100%;
  animation: gradientMove 3s ease-in-out infinite;
}

.admin-stat-card.critical {
  border-color: #e74c3c;
}

.admin-stat-card.critical::before {
  background: linear-gradient(90deg, #e74c3c, #c0392b, #e74c3c);
}

.admin-stat-card.warning {
  border-color: #f39c12;
}

.admin-stat-card.warning::before {
  background: linear-gradient(90deg, #f39c12, #e67e22, #f39c12);
}

.admin-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: #e4a729;
}

.admin-stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}
.admin-stat-icon .ico {
  width: 1.7rem;
  height: 1.7rem;
  color: #e4a729;
  vertical-align: middle;
}
/* Status-prik (afløser farvede emoji-cirkler) */
.admin-status-dot {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  vertical-align: middle;
}

.admin-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #575c4f;
  margin-bottom: 0.3rem;
  line-height: 1;
}

.admin-stat-label {
  color: #666;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.admin-tab-button {
  flex: 1;
  min-width: 150px;
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
}

.admin-tab-button:hover {
  border-color: #e4a729;
  background: #fffaf0;
  transform: translateY(-2px);
}

.admin-tab-button.active {
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 100%);
  color: white;
  border-color: #e4a729;
  box-shadow: 0 4px 12px rgba(228, 167, 41, 0.3);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}


.error-message {
  text-align: center;
  padding: 2rem;
  color: #e74c3c;
  font-size: 1.1rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .vejen-header {
    flex-direction: column;
    align-items: stretch;
  }

  .vejen-kpi-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .kpi-value {
    font-size: 2rem;
  }

  .vejen-metrics-table {
    display: table !important; /* Force show on mobile */
    font-size: 0.75rem;
  }

  .vejen-metrics-table th,
  .vejen-metrics-table td {
    padding: 0.5rem 0.25rem;
  }
}

/* Admin Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  border: none;
  border-bottom: 1px solid #eee;
  padding: 0.75rem;
  text-align: left;
}

.admin-table th {
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-table tbody tr:hover {
  background-color: #f8f9fa;
}

.admin-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* Session Status Badges */
.session-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-badge.active {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.session-badge.expired {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.session-badge.pwa {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.session-badge.browser {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* Security Severity Badges */
.severity-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-badge.low {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.severity-badge.medium {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.severity-badge.high {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.severity-badge.critical {
  background: #d6293e;
  color: white;
  border: 1px solid #a11c2b;
}

/* Action Buttons */
.admin-action-button,
.revoke-button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0.25rem;
}

.admin-action-button {
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(228, 167, 41, 0.3);
}

.admin-action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(228, 167, 41, 0.4);
}

.revoke-button {
  background: #e74c3c;
  color: white;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.revoke-button:hover {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4);
}

.revoke-button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Admin Actions Panel */
.admin-actions-panel {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.admin-actions-panel h3 {
  color: #575c4f;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* Filter Controls */
.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-controls label {
  font-weight: 600;
  color: #575c4f;
  font-size: 0.9rem;
}

.filter-controls select {
  padding: 0.6rem 2.2rem 0.6rem 0.9rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  color: #575c4f;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23575c4f' d='M5 7.5L1 3.5h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px;
}

.filter-controls select:hover {
  border-color: #e4a729;
  background: linear-gradient(135deg, #fffaf0 0%, #fff8e7 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(228, 167, 41, 0.2);
}

.filter-controls select:focus {
  border-color: #e4a729;
  outline: none;
  box-shadow: 0 0 0 3px rgba(228, 167, 41, 0.12);
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
}

.filter-controls select option {
  background: white;
  color: #575c4f;
  padding: 0.4rem;
  font-weight: 500;
}

/* Polling Indicator */
.polling-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(87, 92, 79, 0.9);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.polling-indicator.polling {
  background: rgba(228, 167, 41, 0.9);
}

.polling-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27ae60;
  animation: pulse 2s infinite;
}

/* Loading State */
.admin-loading {
  text-align: center;
  padding: 2rem;
  color: #666;
  font-size: 1rem;
}

.admin-loading::after {
  content: '...';
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Empty State */
.admin-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #999;
  font-size: 0.9rem;
}

.admin-empty-state::before {
  content: '📭';
  display: block;
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Admin Section Header */
.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-section-header h3 {
  margin: 0;
  color: #575c4f;
  font-size: 1.3rem;
}

/* Search and Filter Container */
.search-filter-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: #e4a729;
  box-shadow: 0 0 0 3px rgba(228, 167, 41, 0.1);
}

.search-input::placeholder {
  color: #999;
}

.filter-dropdown {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
  font-weight: 600;
  color: #575c4f;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23575c4f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 12px;
}

.filter-dropdown:hover {
  border-color: #e4a729;
  background: linear-gradient(135deg, #fffaf0 0%, #fff8e7 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(228, 167, 41, 0.2);
}

.filter-dropdown:focus {
  border-color: #e4a729;
  outline: none;
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
  box-shadow: 0 0 0 3px rgba(228, 167, 41, 0.15);
}

.filter-dropdown option {
  background: white;
  color: #575c4f;
  padding: 0.5rem;
  font-weight: 500;
}

/* Export Button */
.export-button {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.export-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
  background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
}

.export-button:active {
  transform: translateY(0);
}

.export-button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Admin Add Form */
.admin-add-form {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid #e1e5e9;
}

.admin-add-form h4 {
  color: #575c4f;
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
}

.admin-form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.admin-input {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.admin-input:focus {
  outline: none;
  border-color: #e4a729;
  box-shadow: 0 0 0 3px rgba(228, 167, 41, 0.1);
}

.admin-form-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.admin-remove-button {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-remove-button:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

.admin-remove-button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
}

.admin-email-badge {
  display: inline-block;
  background: #d1ecf1;
  color: #0c5460;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid #bee5eb;
}

.admin-email-badge.current-user {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

/* Bulk Actions */
.bulk-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 2px solid #e1e5e9;
}

.bulk-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #575c4f;
  cursor: pointer;
  user-select: none;
}

.bulk-checkbox,
.session-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #e4a729;
}

.bulk-action-button {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.bulk-action-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.bulk-action-button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

/* Admin Charts */
.admin-charts-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
}

.admin-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.admin-chart-box {
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.admin-chart-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: #e4a729;
}

.admin-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-chart-header h4 {
  margin: 0;
  color: #575c4f;
  font-size: 1.1rem;
  font-weight: 600;
}

.chart-period-selector {
  padding: 0.6rem 2.2rem 0.6rem 0.9rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  color: #575c4f;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23575c4f' d='M5 7.5L1 3.5h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px;
}

.chart-period-selector:hover {
  border-color: #e4a729;
  background: linear-gradient(135deg, #fffaf0 0%, #fff8e7 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(228, 167, 41, 0.2);
}

.chart-period-selector:focus {
  border-color: #e4a729;
  outline: none;
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
  box-shadow: 0 0 0 3px rgba(228, 167, 41, 0.12);
}

.chart-period-selector option {
  background: white;
  color: #575c4f;
  padding: 0.4rem;
  font-weight: 500;
}

.admin-chart-box canvas {
  width: 100% !important;
  height: 300px !important;
  max-height: 300px;
}

/* Responsive Admin Styles */
@media (max-width: 768px) {
  /* Kompakte stat-widgets på mobil/PWA — fylder langt mindre end desktop-kortene */
  .admin-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
  }
  .admin-stat-card {
    padding: 0.6rem 0.45rem;
    border-width: 1px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(87,92,79,0.08);
  }
  .admin-stat-card::before { height: 2px; }
  .admin-stat-card:hover { transform: none; box-shadow: 0 1px 3px rgba(87,92,79,0.08); }
  .admin-stat-icon { font-size: 1.1rem; margin-bottom: 0.2rem; }
  .admin-stat-icon .ico { width: 1.1rem; height: 1.1rem; }
  .admin-stat-value { font-size: 1.2rem; margin-bottom: 0.1rem; }
  .admin-stat-label { font-size: 0.55rem; letter-spacing: 0.2px; line-height: 1.2; }

  .admin-form-row {
    flex-direction: column;
  }

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

  .search-filter-container {
    flex-direction: column;
    align-items: stretch;
  }

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

  .admin-tabs {
    flex-direction: column;
  }

  .admin-tab-button {
    width: 100%;
    min-width: 100%;
  }

  .interne-stats-tabs {
    flex-direction: column;
    padding: 0.75rem;
  }

  .interne-stats-tab-button {
    width: 100%;
    min-width: 100%;
  }

  .admin-table {
    font-size: 0.75rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.5rem 0.25rem;
  }

  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-controls select {
    width: 100%;
  }

  .admin-actions-panel {
    padding: 1rem;
  }

  /* Make admin tables scrollable on mobile */
  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table thead,
  .admin-table tbody {
    display: block;
  }

  .admin-table tr {
    display: flex;
    flex-wrap: nowrap;
    min-width: 100%;
  }

  .admin-table th,
  .admin-table td {
    flex: 1;
    min-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Admin Charts Mobile */
  .admin-charts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .admin-chart-box canvas {
    height: 250px !important;
  }

  .admin-charts-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }
  .admin-stat-value { font-size: 1.15rem; }
  .admin-stat-icon { font-size: 1.05rem; }
}

/* ============================================ */
/* USER SETTINGS MODAL STYLES */
/* ============================================ */

.settings-modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.settings-modal-content {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.settings-modal-header {
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.settings-close {
  font-size: 2rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.settings-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.settings-modal-body {
  padding: 2rem;
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-label {
  display: block;
  font-weight: 600;
  color: #575c4f;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.settings-description {
  color: #666;
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem 0;
  line-height: 1.4;
}

.settings-select {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 0.95rem;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid #d8dcd5;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-weight: 600;
  color: #575c4f;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23575c4f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2l4.5 4 4.5-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 11px;
}

.settings-select:hover {
  border-color: #c2c7bd;
}

.settings-select:focus {
  border-color: #e4a729;
  outline: none;
  box-shadow: 0 0 0 3px rgba(228, 167, 41, 0.25);
}

.settings-select option {
  background: white;
  color: #575c4f;
  padding: 0.5rem;
  font-weight: 500;
}

.settings-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e1e5e9;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.settings-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.settings-btn-cancel {
  background: #e1e5e9;
  color: #575c4f;
}

.settings-btn-cancel:hover {
  background: #d1d5d9;
  transform: translateY(-2px);
}

.settings-btn-save {
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(228, 167, 41, 0.3);
}

.settings-btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(228, 167, 41, 0.4);
}

.settings-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Biometric devices list styles */
.biometric-devices-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.biometric-device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.biometric-device-item:hover {
  border-color: #e4a729;
  box-shadow: 0 4px 12px rgba(228, 167, 41, 0.2);
}

.biometric-device-info {
  flex: 1;
}

.biometric-device-name {
  font-weight: 600;
  color: #575c4f;
  margin-bottom: 0.25rem;
}

.biometric-device-meta {
  font-size: 0.85rem;
  color: #666;
}

.biometric-device-delete {
  padding: 0.5rem 1rem;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.biometric-device-delete:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

.settings-btn-register {
  width: 100%;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.settings-btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
}

.biometric-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #666;
  font-size: 0.95rem;
}

/* Settings notification animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Mobile Settings Modal */
@media (max-width: 768px) {
  .settings-modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .settings-modal-header {
    padding: 1rem;
  }

  .settings-modal-header h2 {
    font-size: 1.2rem;
  }

  .settings-modal-body {
    padding: 1.5rem;
  }

  .settings-modal-footer {
    padding: 1rem;
    flex-direction: column-reverse;
  }

  .settings-btn {
    width: 100%;
  }
}

/* ============================================ */
/* MÆGLERHUSET HERO BANNER STYLES */
/* ============================================ */

.maeglerhuset-hero-banner {
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 50%, #e4a729 100%);
  background-size: 200% 200%;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 12px 40px rgba(228, 167, 41, 0.4);
  position: relative;
  overflow: hidden;
  animation: fadeInScale 0.8s ease-out, gradientShift 8s ease infinite;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.maeglerhuset-hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

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

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.hero-icon {
  font-size: 2rem;
  animation: bounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-text {
  max-width: 900px;
}

.hero-title {
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 4px 12px rgba(0,0,0,0.3);
  letter-spacing: -0.5px;
}

.hero-counter {
  display: inline-block;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 6px 16px rgba(0,0,0,0.4);
  min-width: 80px;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.hero-subtitle {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0.25rem 0 0 0;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-shadow: 0 3px 8px rgba(0,0,0,0.3);
  opacity: 0.95;
}


/* Responsive Hero Banner */
@media (max-width: 768px) {
  .maeglerhuset-hero-banner {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
  }

  .hero-icon {
    font-size: 1.75rem;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .hero-counter {
    font-size: 1.75rem;
    min-width: 70px;
    padding: 0.12rem 0.5rem;
  }

  .hero-subtitle {
    font-size: 0.8rem;
    letter-spacing: 2px;
  }
}

@media (max-width: 480px) {
  .maeglerhuset-hero-banner {
    padding: 0.85rem 1rem;
  }

  .hero-icon {
    font-size: 1.5rem;
  }

  .hero-title {
    font-size: 1.1rem;
  }

  .hero-counter {
    font-size: 1.5rem;
    min-width: 60px;
    padding: 0.1rem 0.4rem;
  }

  .hero-subtitle {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
  }
}

/* ============================================
   Property Browser Styles
   ============================================ */

.property-type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 100%);
  color: white;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Mobile Property Cards */
.mobile-properties-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
}

.mobile-property-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-property-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.property-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

.property-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.property-detail {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.property-price-change {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

/* Desktop table enhancements for property browser */
.styled-table tbody tr:hover {
  background-color: #f8f9fa;
  transform: scale(1.005);
}

/* Responsive adjustments for property browser */
@media (max-width: 768px) {
  .search-filter-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .filter-dropdown {
    width: 100%;
  }

  .property-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .mobile-property-card {
    padding: 0.85rem;
  }

  .property-type-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }
}

/* ============================================
   Property Type Overview Styles
   ============================================ */

.new-badge {
  background: #e74c3c;
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============================================
   MOBILE-FRIENDLY FILTER CONTROLS
   ============================================ */

/* Desktop filters - Show on desktop, hide on mobile */
.desktop-filters {
  display: flex;
}

/* Mobile filters - Hide on desktop, show on mobile */
.mobile-filters-header {
  display: none;
}

.chart-title-bar-mobile {
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: white;
  padding: 1rem 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
}

.mobile-filters-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: white;

  /* Ensure touch events work properly */
  position: relative;
  isolation: isolate; /* Creates new stacking context */
}

.mobile-filter-dropdown {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #d8dcd5;
  background: white;
  cursor: pointer;
  transition: none; /* NO transitions to prevent iOS conflicts */
  font-weight: 600;
  color: #575c4f;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23575c4f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2l4.5 4 4.5-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 11px;
  min-height: 48px; /* Extra tall for easy mobile tapping */

  /* iOS/PWA specific fixes */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
  touch-action: manipulation;
  position: relative;
  z-index: 1;
}

/* Completely disable ALL focus states on mobile dropdowns */
.mobile-filter-dropdown:focus,
.mobile-filter-dropdown:focus-visible,
.mobile-filter-dropdown:active {
  outline: none !important;
  border-color: #d8dcd5 !important;
  background: white !important;
  box-shadow: none !important;
}

.mobile-filter-dropdown option {
  background: white;
  color: #575c4f;
  padding: 1rem;
  font-weight: 500;
  font-size: 1rem;
}

/* Prevent iOS from interfering with select */
.mobile-filter-dropdown::-webkit-contacts-auto-fill-button,
.mobile-filter-dropdown::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
}

/* Responsive - Show/hide appropriate filters */
@media (max-width: 768px) {
  /* Hide desktop filters on mobile */
  .desktop-filters {
    display: none !important;
  }

  /* Show mobile filters */
  .mobile-filters-header {
    display: block;
  }

  .chart-title-bar-mobile {
    font-size: 1.1rem;
    padding: 0.85rem 1rem;
  }

  .mobile-filter-dropdown {
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
    min-height: 46px;
  }
}

@media (max-width: 480px) {
  .chart-title-bar-mobile {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }

  .mobile-filter-dropdown {
    font-size: 0.9rem;
    padding: 0.75rem 0.9rem;
    min-height: 44px;
  }

  .mobile-filters-stack {
    gap: 0.6rem;
    padding: 0.85rem;
  }
}

/* Mobile Property Overview */
.mobile-property-overview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
}

.mobile-overview-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.overview-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f0f0f0;
}

.overview-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.overview-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.stat-value-large {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e4a729;
}

/* Desktop table styling for overview */
.styled-table thead th {
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: white;
  font-weight: 600;
  padding: 1rem;
}

.styled-table tbody td {
  padding: 1rem;
  vertical-align: middle;
}

@media (max-width: 480px) {
  .overview-stats-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    gap: 0.6rem;
  }

  .stat-value-large {
    font-size: 1.25rem;
  }
}

/* Property details expansion styling */
.clickable-stat.has-data {
  transition: all 0.2s ease;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
}

.clickable-stat.has-data:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.toggle-arrow {
  font-size: 0.7rem;
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.row-expanded {
  background-color: #f0f4f8 !important;
}

.property-details-row {
  background-color: #f8fafb !important;
  border-left: 3px solid #e4a729;
}

.property-details-row td {
  padding: 0 !important;
}

.property-details-content {
  padding: 1rem 1.5rem;
  background-color: #f8fafb;
  border-top: 1px solid #e0e4e8;
  border-bottom: 2px solid #e0e4e8;
  animation: slideDown 0.3s ease-out;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  overflow: visible;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.property-details-header {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd;
  width: 100%;
  word-wrap: break-word;
  overflow: visible;
}

.property-address-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  max-height: 400px;
  overflow-y: auto;
  width: 100%;
}

.property-address-item {
  font-size: 0.9rem;
  color: #555;
  padding: 0.3rem 0.5rem;
  line-height: 1.4;
}

.property-address-item:hover {
  background-color: #eef2f5;
  border-radius: 3px;
}

.property-address-more {
  font-size: 0.9rem;
  color: #e4a729;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #fff9e6;
  border-radius: 4px;
  text-align: center;
}

/* Boligsiden link styling */
.bolig-link {
  text-decoration: none;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  margin-left: 0.3rem;
}

.bolig-link:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Mobile property details styling */
.clickable-mobile-stat {
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 4px;
  padding: 0.5rem;
  margin: -0.5rem;
}

.clickable-mobile-stat:active {
  background-color: rgba(228, 167, 41, 0.1);
}

.toggle-arrow-mobile {
  font-size: 0.7rem;
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.card-expanded {
  background-color: #f0f4f8 !important;
}

.mobile-property-details {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8fafb;
  border-top: 2px solid #e4a729;
  border-radius: 4px;
  animation: slideDown 0.3s ease-out;
}

.mobile-details-header {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.mobile-address-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  max-height: 300px;
  overflow-y: auto;
}

.mobile-address-item {
  font-size: 0.85rem;
  color: #555;
  padding: 0.25rem 0.5rem;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.mobile-address-more {
  font-size: 0.85rem;
  color: #e4a729;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #fff9e6;
  border-radius: 4px;
  text-align: center;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .property-details-content {
    padding: 1rem;
  }

  .property-address-item {
    font-size: 0.85rem;
  }

  .property-details-header {
    font-size: 0.9rem;
  }
}

/* ==========================================
   MARKEDSANDEL CARDS
   ========================================== */

.market-share-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.market-share-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1.5rem;
  transition: all 0.3s ease;
  border-top: 4px solid #e4a729;
}

.market-share-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(228,167,41,0.2);
}

.market-share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding: 1rem;
  margin: -1.5rem -1.5rem 1.2rem -1.5rem;
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  border-radius: 8px 8px 0 0;
}

.market-share-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
}

.market-share-card-zip {
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
}

.market-share-stats {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.market-share-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f5f5f5;
}

.market-share-stat-row:last-child {
  border-bottom: none;
}

.market-share-stat-row .stat-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.market-share-stat-row .stat-values {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.stat-divider {
  color: #ccc;
  font-weight: 400;
}

/* Farvede andele */
.market-share-postnummer {
  color: #27ae60;
  font-weight: 700;
}

.market-share-kommune {
  color: #e74c3c;
  font-weight: 700;
}

/* Responsive styling for mobil */
@media (max-width: 768px) {
  .market-share-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .market-share-card {
    padding: 1.2rem;
  }

  .market-share-card-title {
    font-size: 1rem;
  }

  .market-share-card-zip {
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
  }

  .market-share-stat-row .stat-label {
    font-size: 0.85rem;
  }

  .market-share-stat-row .stat-values {
    font-size: 0.9rem;
  }
}

/* ==========================================
   PULL-TO-REFRESH INDICATOR
   ========================================== */

#pullToRefreshIndicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#pullToRefreshIndicator .refresh-spinner {
  font-size: 2rem;
  transition: transform 0.2s ease;
}

#pullToRefreshIndicator .refresh-text {
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =============================================================================
   BETA TOOLS - Historisk Salgsanalyse
   ============================================================================= */

/* Tools Dropdown */
.tools-dropdown-container {
  position: relative;
  flex: 1;
  display: flex;
}

.tools-parent-tab {
  position: relative;
  flex: 1;
}

.dropdown-arrow {
  display: none; /* Skjult på både desktop og mobil */
}

.tools-parent-tab.active .dropdown-arrow {
  transform: rotate(180deg);
}

.tools-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 1000;
  margin-top: 0;
  overflow: hidden;
}

.tools-dropdown-item {
  display: block;
  width: 100%;
  background: transparent;
  color: white;
  border: none;
  padding: 12px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.tools-dropdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.tools-dropdown-item:hover::before {
  left: 100%;
}

.tools-dropdown-item:hover {
  background-color: rgba(255,255,255,0.1);
  transform: translateX(5px);
}

.tools-dropdown-item:first-child {
  border-top: 1px solid rgba(255,255,255,0.1);
}

.tools-dropdown-item:last-child {
  border-radius: 0 0 6px 6px;
}

.tools-dropdown-item.active {
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 100%);
  color: white;
  font-weight: bold;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Feedback Form Styling */
.feedback-container {
  padding: 2rem;
}

.feedback-field {
  margin-bottom: 1.5rem;
}

.feedback-field label {
  display: block;
  font-weight: 600;
  color: #575c4f;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.feedback-field input,
.feedback-field textarea,
.feedback-field select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
  box-sizing: border-box;
}

.feedback-field input:focus,
.feedback-field textarea:focus,
.feedback-field select:focus {
  outline: none;
  border-color: #e4a729;
  box-shadow: 0 0 0 3px rgba(228, 167, 41, 0.1);
}

.feedback-field textarea {
  resize: vertical;
  min-height: 120px;
}

#feedbackSubmitBtn {
  width: 100%;
  background: linear-gradient(135deg, #e4a729 0%, #f5c842 100%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(228, 167, 41, 0.3);
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

#feedbackSubmitBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(228, 167, 41, 0.4);
}

#feedbackSubmitBtn:active {
  transform: translateY(0);
}

#feedbackSubmitBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#feedbackMessage {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 1rem;
  font-weight: 500;
  text-align: center;
}

.beta-tools-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Search Section */
.beta-search-section {
  padding: 2rem;
}

.beta-search-section h3 {
  color: #3f443b;
  margin-bottom: 0.5rem;
}

.beta-search-input-wrapper {
  position: relative;
  margin: 1rem 0;
  background: white;
  border-radius: 8px;
}

.beta-search-input {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.5;
  border: 1.5px solid rgba(87,92,79,0.18);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

/* Ghost text for inline autocomplete preview */
.beta-ghost-suffix {
  position: absolute;
  /* top and left will be set dynamically by JS */
  color: #bbb; /* Gray preview text */
  pointer-events: none;
  z-index: 1;
  white-space: pre; /* Preserve whitespace */
  /* Font properties will be copied from input via JS for perfect match */
}

/* Real input on top with transparent background */
.beta-search-input-real {
  position: relative;
  background: transparent;
  z-index: 2;
  color: #3f443b;
}

.beta-search-input:focus {
  outline: none;
  border-color: #e4a729;
  box-shadow: 0 0 0 3px rgba(228,167,41,0.15);
}

/* Autocomplete Dropdown */
.beta-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e4a729;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
  padding: 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.autocomplete-item:hover {
  background-color: #fff8e6;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-address {
  font-weight: 600;
  color: #3f443b;
  margin-bottom: 0.25rem;
}

.autocomplete-location {
  font-size: 0.9rem;
  color: #8a8f82;
}

.autocomplete-loading,
.autocomplete-error,
.autocomplete-empty {
  padding: 1rem;
  text-align: center;
  color: #666;
}

.autocomplete-error {
  color: #e74c3c;
}

/* Property Info Card */
.beta-property-info {
  margin: 1.5rem 0;
}

.property-info-card {
  background: linear-gradient(135deg, rgba(228,167,41,0.08), rgba(87,92,79,0.045));
  border-left: 3px solid #e4a729;
  border-radius: 10px;
  padding: 1.5rem;
}

.property-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(87,92,79,0.12);
  gap: 1rem;
}

.property-info-row:last-child {
  border-bottom: none;
}

.property-info-label {
  font-weight: 600;
  color: #44483f;
  flex-shrink: 0;
}

.property-info-value {
  color: #3f443b;
  text-align: right;
  min-width: 0;
  word-break: break-word;
}

/* To-kolonne grid med lodret skillelinje på desktop */
.property-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  column-gap: 2rem;
  position: relative;
}
.property-info-divider {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px;
  background: rgba(87,92,79,0.12);
}

/* Mobil/PWA: én kolonne så data ikke mases sammen; skjul skillelinje + tomme balance-rækker */
@media (max-width: 768px) {
  .property-info-grid { grid-template-columns: 1fr; column-gap: 0; }
  .property-info-divider { display: none; }
  .property-info-row:has(.property-info-label:empty) { display: none; }
}

.property-info-loading,
.property-info-error {
  padding: 1rem;
  text-align: center;
  border-radius: 8px;
  background: #f8f9fa;
}

.property-info-error {
  background: #fee;
  color: #e74c3c;
}

/* Search Parameters */
.beta-search-params {
  margin: 1.5rem 0;
}

.beta-param-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.beta-param-label {
  font-weight: 600;
  color: #44483f;
}

.beta-radius-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(87,92,79,0.15);
  outline: none;
  -webkit-appearance: none;
}

.beta-radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e4a729;
  cursor: pointer;
  transition: transform 0.2s;
}

.beta-radius-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.beta-radius-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e4a729;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.beta-radius-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Time Range Select */
.beta-time-select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  color: #3f443b;
  border: 1.5px solid rgba(87,92,79,0.18);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.beta-time-select:focus {
  outline: none;
  border-color: #e4a729;
  box-shadow: 0 0 0 3px rgba(228,167,41,0.15);
}

.beta-time-select:hover {
  border-color: #e4a729;
}

/* Checkbox */
.beta-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: #44483f;
  user-select: none;
}

.beta-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #e4a729;
}

/* Number Input */
.beta-number-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  color: #3f443b;
  border: 1.5px solid rgba(87,92,79,0.18);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.beta-number-input:focus {
  outline: none;
  border-color: #e4a729;
  box-shadow: 0 0 0 3px rgba(228,167,41,0.15);
}

.beta-number-input::placeholder {
  color: #aab0a2;
}

/* Smaller styling for filter inputs */
.beta-filter-input {
  padding: 0.5rem;
  font-size: 0.9rem;
  border-radius: 6px;
}

/* Advanced filters grid layout */
.beta-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}

.beta-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.beta-filter-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #44483f;
}

.beta-filter-inputs {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.beta-filter-separator {
  color: #8a8f82;
  font-weight: bold;
  flex-shrink: 0;
}

/* Mobile: Stack filters vertically */
@media (max-width: 768px) {
  .beta-filters-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.beta-param-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #8a8f82;
  font-style: italic;
}

/* Search Button */
.beta-search-button {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #3f443b;
  background: linear-gradient(135deg, #e4a729 0%, #c98a16 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(201,138,22,0.28);
}

.beta-search-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #d89b1f 0%, #b87d12 100%);
  box-shadow: 0 6px 14px rgba(201,138,22,0.32);
}

.beta-search-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Results Section */
.beta-results-section {
  min-height: 300px;
}

.beta-empty-state,
.search-loading,
.search-error {
  text-align: center;
  padding: 3rem;
  color: #8a8f82;
}

.search-error {
  color: #e74c3c;
}

/* Statistics */
.beta-statistics {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
}

.beta-statistics h3 {
  color: #e4a729;
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: linear-gradient(135deg, rgba(228,167,41,0.08), rgba(87,92,79,0.045));
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 3px solid #e4a729;
}

.stat-label {
  font-size: 0.9rem;
  color: #8a8f82;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #3f443b;
}

/* Results Table */
.beta-results-table {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
  overflow-x: auto;
}

.beta-results-table h3 {
  color: #e4a729;
  margin-bottom: 1.5rem;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.results-table thead {
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: white;
}

.results-table th {
  padding: 0.5rem 0.4rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.results-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.results-table tbody tr:hover {
  background-color: #fff8e6;
}

.results-table td {
  padding: 0.5rem 0.4rem;
}

.price-cell {
  font-weight: 600;
  color: #27ae60;
}

.price-reduction {
  color: #e74c3c;
  font-weight: 600;
}

/* Active listings table specific styles */
.active-listings-table th:first-child,
.active-listings-table td:first-child {
  text-align: center;
  padding: 0.5rem;
}

.active-listings-table img {
  display: block;
  margin: 0 auto;
}

/* Energy Label Badge Styles */
.energy-label-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 24px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
}

.energy-label-badge .label-main {
  font-size: 0.85rem;
  font-weight: 700;
}

.energy-label-badge .label-sub {
  font-size: 0.55rem;
  margin-left: 1px;
  opacity: 0.9;
}

/* Energy label colors */
.energy-label-A2020 { background-color: #00A651; color: #FFFFFF; }
.energy-label-A2015 { background-color: #00A651; color: #FFFFFF; }
.energy-label-A2010 { background-color: #00A651; color: #FFFFFF; }
.energy-label-A { background-color: #00A651; color: #FFFFFF; }
.energy-label-B { background-color: #9ACD32; color: #FFFFFF; }
.energy-label-C { background-color: #C5E063; color: #333333; }
.energy-label-D { background-color: #FFF200; color: #333333; }
.energy-label-E { background-color: #F7941D; color: #FFFFFF; }
.energy-label-F { background-color: #ED1C24; color: #FFFFFF; }
.energy-label-G { background-color: #ED1C24; color: #FFFFFF; }
.energy-label-unknown { background-color: #999999; color: #FFFFFF; }

/* Expired energy label */
.energy-label-expired {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Energy label tooltip */
.energy-label-wrapper {
  position: relative;
  display: inline-block;
}

.energy-label-tooltip {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: normal;
  opacity: 0;
  transition: opacity 0.2s;
}

.energy-label-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.energy-label-wrapper:hover .energy-label-tooltip {
  visibility: visible;
  opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  /* Beta Tools mobile optimization */
  .beta-search-section {
    padding: 1rem;
  }

  .beta-search-input-wrapper {
    margin: 0.75rem 0;
  }

  .beta-search-input {
    padding: 0.875rem;
    font-size: 16px; /* Prevents iOS zoom on focus */
    box-sizing: border-box;
  }

  .beta-info-note {
    padding: 0.625rem 0.875rem !important;
    font-size: 0.8rem !important;
  }

  .beta-info-note p {
    font-size: 0.8rem !important;
  }

  .beta-param-row {
    margin-top: 0.75rem !important;
  }

  .beta-param-label {
    font-size: 0.9rem;
  }

  .beta-search-button {
    padding: 0.875rem;
    font-size: 1rem;
  }

  /* Autocomplete optimized for mobile */
  .beta-autocomplete-dropdown {
    max-height: 250px;
    font-size: 0.9rem;
  }

  .autocomplete-item {
    padding: 0.875rem;
  }

  .autocomplete-address {
    font-size: 0.9rem;
  }

  .autocomplete-location {
    font-size: 0.8rem;
  }

  /* Property info card mobile */
  .property-info-card {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .property-info-row {
    padding: 0.5rem 0;
  }

  .property-info-label {
    font-size: 0.85rem;
  }

  .property-info-value {
    font-size: 0.85rem;
  }

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

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .beta-results-table {
    padding: 1rem;
  }

  .results-table {
    font-size: 0.85rem;
  }

  .results-table th,
  .results-table td {
    padding: 0.75rem 0.5rem;
  }

  /* Make table scrollable horizontally on mobile */
  .beta-results-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .results-table {
    min-width: 800px;
  }
}

/* ============================================================
   ANGREBSVÆRKTØJ
   ============================================================ */

.attack-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid #e0e0e0;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
}

.attack-sort-btn {
  background: #575c4f;
  color: white;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.attack-sort-btn:hover {
  background: #6b7060;
}

.attack-email-btn {
  background: #e4a729;
  color: white;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.attack-email-btn:hover {
  background: #c98f1e;
}

.attack-email-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.attack-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 820px;
}

.attack-th {
  background: #575c4f;
  color: white;
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.attack-th-right {
  text-align: right;
}

.attack-th-center {
  text-align: center;
}

.attack-td {
  padding: 7px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.attack-td-right {
  text-align: right;
  white-space: nowrap;
}

.attack-td-center {
  text-align: center;
}

.attack-row-alt {
  background: #fafafa;
}

.attack-days {
  font-weight: 700;
  color: #575c4f;
}

.attack-address-link {
  color: #2c5f9e;
  text-decoration: none;
  font-size: 0.88rem;
}

.attack-address-link:hover {
  text-decoration: underline;
}

.attack-agent {
  font-size: 0.82rem;
  color: #555;
  white-space: nowrap;
}

.attack-td-check {
  width: 32px;
  min-width: 32px;
  padding-left: 8px;
  padding-right: 4px;
}

/* ============================================================ */
/* Salgsplan (kundevendt salgspræsentation)                     */
/* ============================================================ */
.sp-tool { max-width: 1060px; display: flex; flex-direction: column; gap: 1.5rem; }

/* Trin-kort: samme look som sitets øvrige kort (hvid · 16px · blød olivenskygge) */
.sp-step {
  background: #fff; border-radius: 16px; padding: 1.5rem 1.6rem 1.7rem;
  box-shadow: 0 1px 2px rgba(87,92,79,0.04), 0 4px 16px rgba(87,92,79,0.06);
}
.sp-step-head { display: flex; align-items: flex-start; gap: 0.85rem; margin-bottom: 1.25rem; }
.sp-step-badge {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
  color: #fff; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(87,92,79,0.25);
}
.sp-step-titles { flex: 1; min-width: 0; }
.sp-step-title {
  margin: 0; color: #3f443b; font-size: 1.12rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.45rem;
}
.sp-step-title .ico { color: #e4a729; width: 18px; height: 18px; }
.sp-step-sub { margin: 0.25rem 0 0; color: #8a8f82; font-size: 0.88rem; line-height: 1.45; }

.sp-property-info { margin-top: 1rem; }
.sp-property-card {
  background: linear-gradient(135deg, rgba(228,167,41,0.08), rgba(87,92,79,0.045));
  border-left: 3px solid #e4a729; padding: 0.85rem 1rem; border-radius: 10px;
  font-size: 0.92rem; color: #3f443b; line-height: 1.5;
}
.sp-loading { color: #8a8f82; font-style: italic; }
.sp-error { color: #c0492f; }
.sp-muted { color: #8a8f82; font-size: 0.85rem; }

.sp-params { margin-top: 1.1rem; display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }

.sp-btn {
  background: #575c4f; color: #fff; border: none; padding: 0.6rem 1.1rem;
  border-radius: 10px; cursor: pointer; font-size: 0.9rem; font-family: inherit; font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.sp-btn:hover { background: #4b4f44; }
.sp-btn:active { transform: translateY(1px); }
.sp-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.sp-btn .ico { width: 16px; height: 16px; }
.sp-btn-primary {
  background: linear-gradient(135deg, #e4a729 0%, #c98a16 100%);
  color: #3f443b; font-weight: 700; box-shadow: 0 2px 8px rgba(201,138,22,0.28);
}
.sp-btn-primary:hover { background: linear-gradient(135deg, #d89b1f 0%, #b87d12 100%); }
.sp-btn-sm { padding: 0.36rem 0.7rem; font-size: 0.8rem; border-radius: 8px; }

.sp-results { display: flex; flex-direction: column; gap: 1.5rem; }
.sp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.sp-col h4 {
  color: #44483f; margin: 0 0 0.6rem; font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.sp-pick-list {
  max-height: 340px; overflow-y: auto; padding: 0.4rem; background: #fcfcfb;
  border: 1px solid rgba(87,92,79,0.12); border-radius: 12px;
}
.sp-pick {
  display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.7rem; align-items: center;
  padding: 0.55rem 0.6rem; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
  transition: background 0.12s ease;
}
.sp-pick + .sp-pick { margin-top: 2px; }
.sp-pick:hover { background: rgba(87,92,79,0.055); }
.sp-pick input { grid-row: span 2; accent-color: #e4a729; width: 16px; height: 16px; }
.sp-pick-main { font-weight: 600; color: #3f443b; }
.sp-pick-meta { grid-column: 2; color: #8a8f82; font-size: 0.78rem; }

.sp-builder-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* To-kolonne builder: felter til venstre, klistret forside-preview til højre */
.sp-builder-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.8rem; align-items: start; }
/* Handlingsknapperne spænder over begge kolonner og ligger øverst (som før) på desktop */
.sp-builder-grid > .sp-builder-actions { grid-column: 1 / -1; }
.sp-builder-main { min-width: 0; }
.sp-builder-side { position: sticky; top: 1rem; }
.sp-builder h4 {
  color: #44483f; margin: 1.2rem 0 0.45rem; font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.sp-builder-main > h4:first-child, .sp-builder-side h4 { margin-top: 0; }
.sp-textarea, .sp-input {
  width: 100%; box-sizing: border-box; border: 1px solid rgba(87,92,79,0.18);
  border-radius: 10px; padding: 0.7rem 0.8rem; font-family: inherit; font-size: 0.92rem;
  color: #3f443b; background: #fcfcfb; resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.sp-textarea:focus, .sp-input:focus {
  outline: none; border-color: #e4a729; background: #fff;
  box-shadow: 0 0 0 3px rgba(228,167,41,0.15);
}
.sp-input[readonly] { background: #f4f5f2; color: #8a8f82; }
.sp-agent-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.sp-builder-main .sp-btn-primary {
  margin-top: 1.5rem; width: 100%; justify-content: center; padding: 0.8rem; font-size: 1rem;
}
.sp-btn-side { margin-top: 0.7rem; width: 100%; justify-content: center; }

.sp-img-preview { margin-bottom: 0.5rem; }
.sp-cover-thumb { width: 100%; max-width: 480px; border-radius: 8px; display: block; border: 1px solid #e9ecef; }
.sp-img-controls { margin-top: 0.6rem; display: flex; gap: 0.7rem; align-items: flex-start; flex-wrap: wrap; flex-direction: column; }
.sp-heading-row { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.sp-heading-label { font-size: 0.8rem; }

/* Live forside-preview (tro mini-kopi af PDF-forsiden i A4-forhold) */
.sp-cover-preview {
  width: 100%; max-width: 300px; aspect-ratio: 210 / 297;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid #e9ecef; border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  /* Én sammenhængende gradient bag hele forsiden (matcher PDF'en) – ingen farveovergange */
  background: linear-gradient(160deg, #575c4f 0%, #4b4f44 100%);
}
.sp-cp-band { background: transparent; text-align: center; }
.sp-cp-top { padding: 5% 0 4.5%; }
.sp-cp-logo { height: 16px; width: auto; }
.sp-cp-hero { flex: 1; overflow: hidden; min-height: 0; position: relative; }
.sp-cp-img { width: 100%; height: 100%; display: block; }
/* Verifikations-pin for skråfoto: tegner boligens projicerede punkt, så mægleren
   kan tjekke at det sidder på huset. Spidsen af 📍 peger på punktet. */
.sp-cp-pin { position: absolute; transform: translate(-50%, -92%); font-size: 1.4rem; line-height: 1;
  pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); z-index: 2; }
.sp-cp-crop { object-fit: cover; }
.sp-cp-full { object-fit: contain; }
.sp-cp-missing { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #575c4f, #6b7060); color: #fff; font-size: 0.7rem; text-align: center; padding: 0 1rem; }
.sp-cp-bottom { color: #fff; padding: 5% 8% 6.5%; }
.sp-cp-eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 0.5rem; color: #cdd1c4; margin-bottom: 0.35rem; }
.sp-cp-addr { font-size: 0.95rem; font-weight: bold; line-height: 1.1; color: #fff; }
.sp-cp-divider { width: 48px; height: 2px; background: #e4a729; margin: 0.5rem auto 0; }
.sp-cp-city { font-size: 0.6rem; color: #cdd1c4; margin-top: 0.4rem; }

/* Segmenterede toggles (beskæring + kilde) */
.sp-toggle { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.sp-toggle-btn {
  font-size: 0.8rem; padding: 0.32rem 0.6rem; border: 1px solid #ccd0d4; background: #f6f7f8;
  color: #44484d; border-radius: 6px; cursor: pointer; line-height: 1; white-space: nowrap;
}
.sp-toggle-btn:hover { background: #eceef0; }
.sp-toggle-btn.active { background: #575c4f; color: #fff; border-color: #575c4f; }

/* Builder kollapser til én kolonne; preview rykker øverst på smalle skærme */
@media (max-width: 900px) {
  .sp-builder-grid { grid-template-columns: 1fr; }
  /* Rækkefølge på mobil/PWA: forsidebillede øverst, derefter knapperne nede ved tekstfelterne */
  .sp-builder-side { position: static; order: -2; }
  .sp-builder-actions { order: -1; }
  .sp-builder-main { order: 0; }
}
@media (max-width: 800px) {
  .sp-cols, .sp-agent-row { grid-template-columns: 1fr; }
}

/* Salgsplan: team-preview i builderen */
.sp-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.sp-team-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  background: #fcfcfb; border: 1px solid rgba(87,92,79,0.12);
}
.sp-team-photo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid #e4a729; flex: 0 0 auto; }
.sp-team-noimg { display: flex; align-items: center; justify-content: center; background: #eef0ea; font-size: 18px; }
.sp-team-name { font-weight: 600; color: #3f443b; font-size: 0.88rem; }
.sp-team-title { color: #8a8f82; font-size: 0.78rem; }

/* Indstillinger: cirkulær profilbillede-cropper (træk + zoom) */
.agent-crop-view { position: relative; width: 200px; height: 200px; border-radius: 50%; overflow: hidden; border: 3px solid #e4a729; background: #eef0ea; cursor: grab; touch-action: none; user-select: none; }
.agent-crop-view.dragging { cursor: grabbing; }
.agent-crop-view img { position: absolute; max-width: none; pointer-events: none; }
.agent-crop-zoom { width: 200px; display: block; margin: 10px 0 4px; }
.agent-crop-hint { font-size: 0.78rem; color: #888; }

/* Indstillinger: butikker jeg arbejder i (multi-valg) */
.settings-workstores { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 6px; }
.settings-workstore { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.settings-workstore input { width: auto; margin: 0; }
@media (max-width: 520px) { .settings-workstores { grid-template-columns: 1fr; } }

/* ==========================================
   INLINE SVG-IKONER (.ico)
   ========================================== */
.ico {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  vertical-align: -0.16em;
  stroke: currentColor;
  fill: none;
  overflow: visible;
}
/* Ikon i overskrifter: lidt større, brand-gul, med luft til teksten */
h2 .ico, h3 .ico, h4 .ico {
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.5rem;
  color: #e4a729;
  vertical-align: -0.14em;
}
/* Ikon i knapper: arver tekstfarven, luft til label */
button .ico, .settings-btn .ico, label.settings-btn .ico { margin-right: 0.45rem; }

/* ==========================================
   SAMLET LET UDTRYK FOR "LYSE" SELECTS PÅ HVIDE KORT
   (afløser tidligere tunge 2px-kanter + gradient + skygge)
   ========================================== */
.beta-time-select,
.filter-dropdown,
.chart-period-selector,
#feedbackType {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid #d8dcd5;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23575c4f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2l4.5 4 4.5-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 11px;
  padding: 0.6rem 2.2rem 0.6rem 0.9rem;
  color: #575c4f;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
#feedbackType { width: 100%; box-sizing: border-box; }
.beta-time-select:hover,
.filter-dropdown:hover,
.chart-period-selector:hover,
#feedbackType:hover { border-color: #c2c7bd; }
.beta-time-select:focus,
.filter-dropdown:focus,
.chart-period-selector:focus,
#feedbackType:focus {
  outline: none;
  border-color: #e4a729;
  box-shadow: 0 0 0 3px rgba(228,167,41,0.25);
}

/* ==========================================
   SKJUL SCROLLBAR GLOBALT (scroll virker stadig)
   ========================================== */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ==========================================
   MOBIL BUNDBJÆLKE + VÆRKTØJER-ACTION-SHEET
   ========================================== */
.bottom-nav { display: none; }
.tools-sheet, .tools-sheet-backdrop { display: none; }

@media (max-width: 768px) {
  /* Topmenu skjules på mobil — erstattes af bundbjælken */
  .topbar { display: none !important; }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.18);
    /* safe-area: knapper sidder OVER hjemme-indikatoren, så app-switcher-gesten ikke trigges */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bn-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 46px;
    padding: 5px 2px 6px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .bn-item .bn-ico { width: 20px; height: 20px; stroke: currentColor; fill: none; display: block; }
  .bn-item span { white-space: nowrap; }
  /* Aktiv = fuld guld (ingen hvid→guld-omfarvning ved tryk) */
  .bn-item.active { color: #e4a729; }

  /* Fjern topbar-fanernes baggrund/hover/shimmer på bundknapperne (den "gule firkant") */
  .bottom-nav .tab-button,
  .bottom-nav .tab-button:hover,
  .bottom-nav .tab-button.active {
    background: transparent;
    box-shadow: none;
    transform: none;
    overflow: visible;
  }
  .bottom-nav .tab-button::before { display: none; }

  /* Indhold under notch (top) + ikke skjult bag bundbjælken */
  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  /* Logo skjult på mobil — sparer plads (app-feeling) */
  .logo-container { display: none; }

  /* Action-sheet (glider op over bjælken) */
  /* Vises KUN når JS fjerner [hidden] — ellers dækker en usynlig backdrop skærmen og spærrer tryk */
  .tools-sheet-backdrop:not([hidden]) { display: block; }
  .tools-sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .tools-sheet-backdrop.open { opacity: 1; }

  .tools-sheet:not([hidden]) { display: block; }
  .tools-sheet {
    position: fixed; left: 0; right: 0;
    bottom: calc(46px + env(safe-area-inset-bottom, 0px));
    z-index: 1002;
    background: linear-gradient(135deg, #575c4f 0%, #6b7060 100%);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    padding: 6px 12px 14px;
    transform: translateY(115%);
    transition: transform 0.22s ease;
  }
  .tools-sheet.open { transform: translateY(0); }
  .tools-sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.4); margin: 6px auto 10px; }
  .tools-sheet-item {
    display: flex; align-items: center; gap: 0.8rem;
    width: 100%;
    padding: 0.9rem 0.8rem;
    background: transparent; border: none;
    border-radius: 10px;
    color: #e4a729; font-size: 1rem; font-weight: 600;
    cursor: pointer; text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  .tools-sheet-item:active { background: rgba(255,255,255,0.14); }
  .tools-sheet-item .bn-ico { width: 22px; height: 22px; stroke: currentColor; fill: none; color: #e4a729; flex: 0 0 auto; }

  /* Sektioner fylder hele skærmen — ingen side-fill, firkantede kanter */
  .container { padding: 0 !important; }
  .styled-table-container,
  .chart-box { border-radius: 0; }
}

/* Slå browserens native pull-to-refresh fra (funktionen er fjernet) */
html, body { overscroll-behavior-y: contain; }

/* Top Video Opslag — kompakt liste (kun mobil PWA, renderes JS-styret) */
.top-videos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0.75rem;
}
.tv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e3e6df;
  border-left: 3px solid #e4a729;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tv-row:active { background: #faf7ef; }
.tv-rank {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e4a729;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv-main { flex: 1 1 auto; min-width: 0; }
.tv-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #3f443b;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tv-meta {
  font-size: 0.72rem;
  color: #8a8f82;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tv-views {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
.tv-views-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: #c98a16;
}
.tv-views-lbl {
  font-size: 0.62rem;
  color: #8a8f82;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Facebook Overblik — samlet nøgletal-widget (kun mobil PWA, JS-styret) */
.fb-overview-card {
  background: #fff;
  border: 1px solid #e3e6df;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(87,92,79,0.06), 0 4px 16px rgba(87,92,79,0.06);
  margin-bottom: 1rem;
}
.fb-ov-hero {
  text-align: center;
  padding: 6px 0 16px;
  border-bottom: 1px solid #eceee8;
}
.fb-ov-hero-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8f82;
}
.fb-ov-hero-value {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
  color: #c98a16;
  margin: 4px 0 2px;
}
.fb-ov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #eceee8;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 14px;
}
.fb-ov-cell {
  background: #fff;
  padding: 12px 14px;
  text-align: center;
}
.fb-ov-cell-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8f82;
}
.fb-ov-cell-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #3f443b;
  margin: 3px 0 2px;
}
.fb-ov-trend {
  font-size: 0.78rem;
  font-weight: 600;
}
.fb-ov-trend.up { color: #4a8a3c; }
.fb-ov-trend.down { color: #c0492f; }
.fb-ov-trend.flat { color: #8a8f82; }
