/* fonthill.css — custom overrides for Fonthill Command View only
   Do not edit athena.css or athena-layout.css — all app-specific styles live here.
   Uses Bootstrap CSS variables where possible so light/dark themes work via Athena. */

/* ─── VENUE CARDS ─────────────────────────────────────────────────────────── */
.fonthill-venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.fonthill-venue-card {
  border-left: 3px solid var(--bs-border-color);
}

.fonthill-venue-card.border-success { border-left-color: var(--bs-success); }
.fonthill-venue-card.border-warning { border-left-color: var(--bs-warning); }
.fonthill-venue-card.border-danger { border-left-color: var(--bs-danger); }

.fonthill-venue-gross {
  font-size: 1.2rem;
  font-weight: 500;
}

.fonthill-yr-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 0.2rem 0;
  border-top: 1px solid var(--bs-border-color-translucent);
}

.fonthill-yr-up { color: var(--bs-success); }
.fonthill-yr-down { color: var(--bs-danger); }
.fonthill-yr-flat { color: var(--bs-secondary-color); }

/* ─── SALES HEADLINE ────────────────────────────────────────────────────────── */
.fonthill-headline-val {
  font-size: 1.75rem;
  font-weight: 500;
}

.fonthill-headline-net {
  font-size: 1.25rem;
  font-weight: 500;
}

/* ─── EVENT ROWS ────────────────────────────────────────────────────────────── */
.fonthill-ev-row {
  border-left: 3px solid transparent;
}

.fonthill-ev-sport { border-left-color: var(--bs-primary) !important; }
.fonthill-ev-pantiles { border-left-color: #8b6bc2 !important; }
.fonthill-ev-live { border-left-color: var(--bs-secondary); }

.fonthill-ev-date {
  min-width: 90px;
  text-align: center;
}

.fonthill-ev-dnum {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* ─── PRIORITY / FROG CARDS ─────────────────────────────────────────────────── */
.fonthill-pcard {
  border-left: 3px solid var(--bs-border-color);
}

.fonthill-pcard.border-danger { border-left-color: var(--bs-danger); }
.fonthill-pcard.border-warning { border-left-color: var(--bs-warning); }
.fonthill-pcard.border-success { border-left-color: var(--bs-success); }

.fonthill-pcard-done .fonthill-pcard-title {
  text-decoration: line-through;
  color: var(--bs-secondary-color);
}

.fonthill-status-btns .btn {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

.fonthill-pcard-clickable {
  cursor: pointer;
}

.fonthill-pcard-clickable:hover {
  border-color: var(--bs-secondary-color);
  background: var(--bs-secondary-bg);
}

/* ─── BANKED ────────────────────────────────────────────────────────────────── */
.fonthill-banked-toggle,
.fonthill-past-toggle {
  cursor: pointer;
}

.fonthill-banked-list,
.fonthill-past-list {
  display: none;
}

.fonthill-banked-list.show,
.fonthill-past-list.show {
  display: block;
}

/* Overlay the native date input on the week button so the calendar
   opens from a real click (and therefore closes on click/tap outside). */
.fonthill-week-picker-btn {
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.fonthill-week-picker-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.fonthill-week-picker-input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

/* ─── SYSTEM CARDS ──────────────────────────────────────────────────────────── */
.fonthill-sys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
}

.fonthill-sys-num {
  font-size: 1.35rem;
  font-weight: 500;
  border: none;
  background: transparent;
  width: 100%;
  padding: 0;
  color: inherit;
}

.fonthill-sys-num:focus {
  outline: none;
}

.fonthill-sys-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--bs-border-radius);
  background: var(--bs-secondary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fonthill-sys-url-input {
  display: none;
}

.fonthill-sys-url-input.show {
  display: block;
}

/* ─── LOADING SKELETON ──────────────────────────────────────────────────────── */
.fonthill-skeleton {
  pointer-events: none;
  opacity: 0.55;
}

.fonthill-skeleton .placeholder {
  display: block;
  min-height: 1rem;
  margin-bottom: 0.5rem;
}

/* ─── SIDEBAR USER ──────────────────────────────────────────────────────────── */
.fonthill-sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid var(--bs-border-color-translucent);
}

.fonthill-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.fonthill-sidebar-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.fonthill-sidebar-user span {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── SECTION SPACING ───────────────────────────────────────────────────────── */
.fonthill-section {
  scroll-margin-top: 1rem;
  margin-bottom: 2rem;
}

.fonthill-section-divider {
  border-top: 1px solid var(--bs-border-color-translucent);
  margin: 2rem 0;
}

/* ─── AUTH GATE ─────────────────────────────────────────────────────────────── */
html.auth-pending body.athena-app {
  visibility: hidden;
}

/* ─── SIDEBAR PAGE STATE ────────────────────────────────────────────────────── */
.athena-nav-link.active,
.athena-nav-link[aria-current="page"] {
  background: var(--athena-surface-soft);
  color: var(--athena-text);
  font-weight: 600;
}

/* ─── SALES REPORTS ─────────────────────────────────────────────────────────── */
.fonthill-reports-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fonthill-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  align-items: flex-end;
}

.fonthill-filter-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--athena-muted);
  margin-bottom: 0.35rem;
}

.fonthill-chip-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--chip-colour, var(--bs-secondary));
  display: inline-block;
  flex-shrink: 0;
}

.fonthill-venue-chip,
.fonthill-year-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-color: color-mix(in srgb, var(--chip-colour, var(--bs-border-color)) 55%, var(--bs-border-color));
}

.fonthill-venue-chip.active,
.fonthill-year-chip.active {
  font-weight: 600;
  color: var(--athena-text);
  background: color-mix(in srgb, var(--chip-colour, var(--bs-primary)) 16%, var(--athena-surface));
  border-color: var(--chip-colour, var(--bs-primary));
}

.fonthill-reports-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 1100px) {
  .fonthill-reports-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .fonthill-reports-summary {
    grid-template-columns: 1fr;
  }
}

.fonthill-stat-card {
  min-width: 0;
  border-left: 4px solid var(--stat-accent, var(--bs-border-color));
}

.fonthill-stat-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fonthill-reports-summary-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.fonthill-reports-summary-value:has(.fonthill-mix-grid) {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.fonthill-mix-grid {
  display: grid;
  gap: 0.35rem 0.75rem;
}

.fonthill-mix-col {
  min-width: 0;
}

.fonthill-mix-name {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
}

.fonthill-mix-share {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.fonthill-mix-delta {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
}

.fonthill-stat-bar {
  height: 0.35rem;
  border-radius: 999px;
  background: var(--athena-surface-soft);
  overflow: hidden;
  margin-top: 0.55rem;
}

.fonthill-stat-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--stat-accent, var(--bs-primary));
}

.fonthill-reports-chart-wrap {
  position: relative;
  height: 22rem;
}

.fonthill-reports-chart-wrap-sm {
  height: 16.5rem;
}

.fonthill-reports-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .fonthill-reports-extra-grid {
    grid-template-columns: 1fr;
  }
}

.fonthill-exceptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 700px) {
  .fonthill-exceptions {
    grid-template-columns: 1fr;
  }
}

.fonthill-exceptions-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fonthill-exceptions-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent);
  font-size: 0.875rem;
}


.fonthill-reports-chart-caption {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.fonthill-reports-table-wrap {
  overflow: auto;
  max-height: 28rem;
}

.fonthill-reports-table {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.fonthill-reports-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--athena-surface);
  white-space: nowrap;
  vertical-align: bottom;
}

.fonthill-th-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}

.fonthill-th-sort:hover,
.fonthill-th-sort:focus-visible {
  color: var(--bs-primary);
}

.table.fonthill-reports-table td.fonthill-yr-up,
.table.fonthill-reports-table .fonthill-yr-up {
  color: var(--bs-success);
}

.table.fonthill-reports-table td.fonthill-yr-down,
.table.fonthill-reports-table .fonthill-yr-down {
  color: var(--bs-danger);
}

.fonthill-reports-table tr.is-best {
  background: color-mix(in srgb, var(--bs-success) 9%, transparent);
}

.fonthill-reports-table tr.is-weak {
  background: color-mix(in srgb, var(--bs-danger) 8%, transparent);
}

.fonthill-th-swatch {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--chip-colour);
  display: inline-block;
}

.fonthill-heading-link {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
