* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
body { display: grid; grid-template-rows: auto 1fr; }

header {
  background: #0d31f3; color: white; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px;
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
.header-refresh {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
}
.header-refresh select {
  padding: 5px 6px; border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15); color: white; border-radius: 4px;
  font-size: 13px; cursor: pointer;
}
.header-refresh select option { color: #000; }
.header-refresh button {
  padding: 5px 12px; border: 0; border-radius: 4px; cursor: pointer;
  font-weight: 600; font-size: 13px; background: white; color: #0d31f3;
}
.header-refresh button:hover { background: #e7ebf7; }
.header-refresh button:disabled { background: #999; color: white; cursor: wait; }
.header-refresh button.secondary {
  background: rgba(255,255,255,0.15); color: white; padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.4);
}
.header-refresh button.secondary:hover { background: rgba(255,255,255,0.28); }
#refresh-status {
  font-size: 12px; color: rgba(255,255,255,0.9); max-width: 360px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#refresh-status.ok { color: #c6f7d3; }
#refresh-status.err { color: #ffd0cc; }
#refresh-status.working { color: #fff3b0; }
#refresh-status.working::after {
  content: "…"; display: inline-block;
}

#lang-switcher {
  background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3);
  padding: 4px 8px; border-radius: 4px; font-size: 13px; cursor: pointer;
}
#lang-switcher option { color: #000; }

body {
  grid-template-areas:
    "header header"
    "sidebar map";
  grid-template-columns: 360px 1fr;
  grid-template-rows: auto 1fr;
  height: 100vh;
}
header { grid-area: header; }
#sidebar { grid-area: sidebar; overflow-y: auto; padding: 12px; background: #f7f8fa; border-right: 1px solid #ddd; }
#map { grid-area: map; }

.filter { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.filter label { font-size: 12px; font-weight: 600; color: #333; }
.filter input[type="text"], .filter input[type="date"], .filter select {
  padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;
}
.filter .quick { display: flex; gap: 4px; margin-top: 4px; }
.filter .quick button {
  padding: 4px 8px; border: 1px solid #ccc; background: white; border-radius: 4px;
  font-size: 12px; cursor: pointer;
}
.filter .quick button:hover { background: #e7ebf7; }

.summary { padding: 8px; background: #0d31f3; color: white; border-radius: 4px; text-align: center; margin-top: 8px; font-weight: 600; }
.summary #count { font-size: 20px; }

#match-list { list-style: none; padding: 0; margin: 10px 0 0 0; }
#match-list li {
  padding: 8px; border-bottom: 1px solid #eee; cursor: pointer; font-size: 13px;
}
#match-list li:hover, #match-list li.active { background: #e7ebf7; }
#match-list .time { font-weight: 600; color: #0d31f3; }
#match-list .venue { font-size: 11px; color: #666; display: block; margin-top: 3px; }
#match-list .comp { font-size: 11px; color: #888; }
.tag {
  display: inline-block; font-size: 10px; padding: 1px 6px;
  background: #e7ebf7; color: #0d31f3; border-radius: 10px;
  margin-left: 4px; vertical-align: middle; font-weight: 600;
}

.leaflet-popup-content { font-size: 13px; line-height: 1.4; }
.leaflet-popup-content strong { color: #0d31f3; }

.office-icon {
  background: #ff3b30; color: white; width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; border: 3px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
