*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #E8570A;
  --orange-light: #F5E8DF;
  --bg: #FAFAF8;
  --white: #FFFFFF;
  --border: #E8E6E1;
  --text: #1A1916;
  --muted: #8C887F;
  --muted2: #C4C0B8;
  --green: #22A06B;
  --red: #D93025;
  --play: 'Playfair Display', serif;
  --sans: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
}

body { font-family: var(--sans); background: var(--bg); color: var(--text); }

/* ── HEADER ── */
.top-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-bar-brand {
  font-family: var(--play);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.top-bar-brand span { color: var(--orange); }
.top-bar-sub {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--mono);
}
.top-bar-right {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

/* ── FILTERS BAR ── */
.filters-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 100;
}

#filter-search {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
  width: 180px;
  outline: none;
  transition: border-color 0.12s;
}
#filter-search:focus { border-color: var(--orange); }
#filter-search::placeholder { color: var(--muted2); }

.filter-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex: 1;
}

.chip {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 2px 8px 2px 6px;
  border-radius: 3px;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { opacity: 0.85; }
.chip-x { font-size: 0.65rem; opacity: 0.8; }

.filter-btn {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
  white-space: nowrap;
  margin-left: auto;
}
.filter-btn:hover { border-color: var(--orange); color: var(--orange); }
.filter-btn.active { border-color: var(--orange); color: var(--orange); background: var(--orange-light); }

.filter-count {
  background: var(--orange);
  color: #fff;
  border-radius: 100px;
  padding: 0 5px;
  font-size: 0.55rem;
  min-width: 16px;
  text-align: center;
}

/* ── FILTER POPUP ── */
.filter-popup {
  position: fixed;
  top: 96px;
  right: 2.5rem;
  width: 480px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.15s, transform 0.15s;
}
.filter-popup.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}
.filter-overlay.open { display: block; }

.filter-popup-inner { padding: 1rem; }

.filter-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.filter-popup-title {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  font-weight: 500;
}
.filter-clear {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s;
}
.filter-clear:hover { color: var(--orange); }

.filter-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.filter-section {}

.filter-section-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted2);
  margin-bottom: 0.4rem;
}
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.tag {
  font-family: var(--mono);
  font-size: 0.63rem;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  user-select: none;
}
.tag:hover { border-color: var(--orange); color: var(--orange); }
.tag.active { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  min-height: calc(100vh - 53px - 44px - 40px);
  gap: 0;
}

/* ── SIDEBARS ── */
.sidebar {
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--white);
}
.sidebar.right { border-right: none; border-left: 1px solid var(--border); }

.sidebar-title {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.site-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.site-item:last-child { border-bottom: none; }
.site-name { font-size: 0.75rem; font-weight: 500; margin-bottom: 2px; }
.site-date {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.dot.green { background: var(--green); }
.dot.red   { background: var(--red); }

.tonight-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.tonight-item:last-child { border-bottom: none; }
.tonight-venue {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.tonight-show { font-size: 0.73rem; font-weight: 500; line-height: 1.3; }
.tonight-meta { font-family: var(--mono); font-size: 0.58rem; color: var(--muted); margin-top: 1px; }

/* ── MAIN ── */
.main { padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1.5rem; }

/* ── SECTION ── */
.section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.section-header:hover { background: var(--bg); }
.section-header-left { display: flex; align-items: center; gap: 0.75rem; }
.section-title {
  font-family: var(--play);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.section-title.today { color: var(--orange); }

.date-nav { display: flex; align-items: center; gap: 0.35rem; }
.date-nav button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 22px; height: 22px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.date-nav button:hover { border-color: var(--orange); color: var(--orange); }
.date-nav .date-display {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text);
  min-width: 90px;
  text-align: center;
}
.date-nav input[type="date"] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
}

.badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  background: var(--orange-light);
  color: var(--orange);
  padding: 2px 7px;
  border-radius: 3px;
}

.chevron { font-size: 0.65rem; color: var(--muted); transition: transform 0.2s; }
.section.collapsed .chevron { transform: rotate(-90deg); }
.section.collapsed .section-body { display: none; }

/* ── TABLE ── */
.section-body { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
thead th {
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 7px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
td { padding: 8px 12px; vertical-align: middle; }

.td-title { font-weight: 500; }
.td-date { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.td-venue { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.td-link a { color: var(--orange); text-decoration: none; font-family: var(--mono); font-size: 0.65rem; }
.td-link a:hover { text-decoration: underline; }

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-family: var(--mono);
  border: 1px solid;
}
.pill.concert    { color: #2563EB; border-color: #BFDBFE; background: #EFF6FF; }
.pill.theatre    { color: #16A34A; border-color: #BBF7D0; background: #F0FDF4; }
.pill.oneman     { color: #D97706; border-color: #FDE68A; background: #FFFBEB; }
.pill.onewoman   { color: #DB2777; border-color: #FBCFE8; background: #FDF2F8; }
.pill.spectacle  { color: #7C3AED; border-color: #DDD6FE; background: #F5F3FF; }
.pill.festival   { color: #0891B2; border-color: #A5F3FC; background: #ECFEFF; }
.pill.autre      { color: var(--muted); border-color: var(--border); background: var(--bg); }

.badge-new {
  font-family: var(--mono);
  font-size: 0.55rem;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--orange-light);
  color: var(--orange);
  margin-left: 5px;
  vertical-align: middle;
}

.empty { padding: 2rem; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }

/* ── FOOTER ── */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 0 2.5rem;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy { font-family: var(--mono); font-size: 0.6rem; color: var(--muted2); }