* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, sans-serif; position: relative; }
#filter-bar { background: #ffffff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; flex-wrap: wrap; gap: 24px; padding: 8px 16px; }
#map { width: 100%; height: calc(100vh - 52px); }
#table-view { width: 100%; height: calc(100vh - 52px); overflow-y: auto; padding: 0; display: none; }
#table-count { padding: 8px 16px; font-size: 13px; line-height: 20px; color: #6b7280; background: #f9fafb; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 10; }
#events-table { width: 100%; border-collapse: collapse; font-size: 14px; }
#events-table thead { background: #f9fafb; position: sticky; top: 37px; z-index: 10; }
#events-table thead th { padding: 10px 16px; border-bottom: 1px solid #e5e7eb; font-size: 12px; font-weight: 600; text-transform: uppercase; color: #6b7280; text-align: left; cursor: pointer; user-select: none; white-space: nowrap; }
#events-table thead th:hover { background: #f3f4f6; }
#events-table td { padding: 10px 16px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
#events-table tbody tr:hover { background: #f3f4f6; }
#events-table td.col-data { width: 100px; white-space: nowrap; }
#events-table td.col-nom { }
#events-table td.col-poblacio { width: 140px; }
#events-table td.col-provincia { width: 100px; }
#events-table td.col-distancies { width: 120px; white-space: nowrap; }
#events-table td.col-desnivell { width: 120px; white-space: nowrap; }
#events-table a { color: #2563eb; text-decoration: none; }
#events-table a:hover { text-decoration: underline; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 12px; font-weight: 600; line-height: 1.4; color: #374151; }
.month-dropdown { position: relative; }
.month-toggle { text-align: left; min-width: 150px; position: relative; padding-right: 24px !important; }
.month-toggle::after { content: '\25BE'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #9ca3af; }
.month-options { display: none; position: absolute; top: 100%; left: 0; z-index: 2000; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); margin-top: 4px; min-width: 150px; max-height: 240px; overflow-y: auto; }
.month-options.open { display: block; }
.month-option { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; font-size: 14px; color: #374151; }
.month-option:hover { background: #f3f4f6; }
.month-option input { accent-color: #2563eb; }
.weekend-filter-group[hidden] { display: none; }
.filter-input { height: 32px; padding: 0 8px; border: 1px solid #e5e7eb; border-radius: 4px; background: #ffffff; color: #374151; font-size: 14px; font-family: system-ui, sans-serif; width: 180px; }
.filter-input:focus { outline: none; border-color: #2563eb; }
.filter-select { height: 32px; padding: 0 8px; border: 1px solid #e5e7eb; border-radius: 4px; background: #ffffff; color: #374151; font-size: 14px; font-family: system-ui, sans-serif; cursor: pointer; }
.filter-select:focus { outline: none; border-color: #2563eb; }
.filter-separator { font-size: 12px; color: #9ca3af; }
#empty-state { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1000; font-size: 16px; font-weight: 600; color: #374151; background: rgba(255,255,255,0.9); padding: 16px 24px; border-radius: 8px; display: none; }
.leaflet-attribution-flag { display: none !important; }
#view-toggle { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.view-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid #e5e7eb; border-radius: 4px; background: #ffffff; cursor: pointer; padding: 0; color: #374151; }
.view-btn svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.view-btn.active { background: #2563eb; color: #ffffff; border-color: #2563eb; }
.popup-card { font-family: system-ui, sans-serif; max-width: 320px; padding: 16px; }
.popup-card h3 { font-size: 16px; font-weight: 600; line-height: 1.2; margin: 0 0 4px 0; }
.popup-card .popup-meta { font-size: 14px; font-weight: 400; line-height: 1.5; color: #374151; margin: 0 0 8px 0; }
.popup-card .popup-separator { border: none; border-top: 1px solid #e5e7eb; margin: 8px 0; }
.popup-card .popup-label { font-size: 12px; font-weight: 600; line-height: 1.4; margin: 0 0 4px 0; }
.popup-card .popup-distance { font-size: 14px; font-weight: 400; line-height: 1.5; padding: 2px 0; }
.popup-card .popup-distance:nth-child(even) { background: #f3f4f6; }
.popup-card .popup-link { display: inline-block; font-size: 14px; font-weight: 400; line-height: 1.5; color: #2563eb; text-decoration: none; margin-top: 8px; }
.popup-card .popup-link:hover { text-decoration: underline; }
.popup-event + .popup-event { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e5e7eb; }
.popup-callout { margin-top: 14px; }
.popup-callout summary { font-size: 13px; font-weight: 600; color: #2563eb; cursor: pointer; list-style: none; }
.popup-callout summary::-webkit-details-marker { display: none; }
.popup-callout summary::before { content: '> '; color: #6b7280; }
.popup-callout[open] summary::before { content: 'v '; }
.popup-callout-body {
  margin-top: 10px;
  padding: 12px 0 0 12px;
  border-left: 3px solid #d1d5db;
  color: #4b5563;
}
.popup-callout-body .popup-event:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.filter-group-checkbox { gap: 4px; }
.confirmed-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: #374151; cursor: pointer; white-space: nowrap; }
.confirmed-label input { accent-color: #2563eb; cursor: pointer; }
.unconfirmed-badge { display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: #b45309; background: #fef3c7; padding: 1px 6px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
