/* The ads admin in Bus Live's colours, on top of Django's admin (which handles light and dark). */
:root, html[data-theme="light"] {
  --primary: #0E7040; --secondary: #0B5E35; --accent: #EAF6EF; --primary-fg: #fff;
  --header-bg: #14212A; --header-color: #E3EAEE; --header-branding-color: #fff; --header-link-color: #fff;
  --breadcrumbs-bg: #0E7040; --link-fg: #0E6B3D; --link-hover-color: #0B5E35; --link-selected-fg: #0B5E35;
  --button-bg: #0E7040; --button-hover-bg: #0B5E35; --default-button-bg: #0B5E35; --default-button-hover-bg: #094d2c;
  --cbl-ink: #14212A; --cbl-muted: #5A6A75; --cbl-rule: #D5DDE2; --cbl-soft: #E6ECEF; --cbl-surface: #fff; --cbl-bg: #F1F4F5;
  --cbl-s1: #2a78d6; --cbl-s2: #eb6834; --cbl-go: #0E7040; --cbl-late: #A65E00; --cbl-cancel: #BA3328;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --primary: #2E8B5A; --secondary: #4CC98A; --accent: #12301F; --primary-fg: #fff;
    --header-bg: #0B1217; --breadcrumbs-bg: #1d5c3c; --link-fg: #6fd6a0; --link-hover-color: #9be6bf; --link-selected-fg: #9be6bf;
    --button-bg: #2E8B5A; --button-hover-bg: #3aa26a; --default-button-bg: #3aa26a; --default-button-hover-bg: #4CC98A;
    --cbl-ink: #E3EAEE; --cbl-muted: #93A3AE; --cbl-rule: #24323C; --cbl-soft: #1A2630; --cbl-surface: #131D25; --cbl-bg: #0B1217;
    --cbl-s1: #3987e5; --cbl-s2: #d95926; --cbl-go: #4CC98A; --cbl-late: #EFA03A; --cbl-cancel: #FF7B6E;
  }
}
html[data-theme="dark"] {
  --primary: #2E8B5A; --secondary: #4CC98A; --accent: #12301F; --primary-fg: #fff;
  --header-bg: #0B1217; --breadcrumbs-bg: #1d5c3c; --link-fg: #6fd6a0; --link-hover-color: #9be6bf; --link-selected-fg: #9be6bf;
  --button-bg: #2E8B5A; --button-hover-bg: #3aa26a; --default-button-bg: #3aa26a; --default-button-hover-bg: #4CC98A;
  --cbl-ink: #E3EAEE; --cbl-muted: #93A3AE; --cbl-rule: #24323C; --cbl-soft: #1A2630; --cbl-surface: #131D25; --cbl-bg: #0B1217;
  --cbl-s1: #3987e5; --cbl-s2: #d95926; --cbl-go: #4CC98A; --cbl-late: #EFA03A; --cbl-cancel: #FF7B6E;
}

#site-name a { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.cbl-logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #0E7040; color: #fff; font-weight: 800; }
.cbl-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 10px 40px; background: var(--darkened-bg); border-bottom: 1px solid var(--hairline-color); font-size: 14px; }
.cbl-nav a { font-weight: 600; } .cbl-nav a.on { color: var(--body-fg); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 767px) { .cbl-nav { padding: 10px 16px; } }

/* status, thumbnails */
.cbl-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cbl-en_ligne { background: #EAF6EF; color: #0B5E35; } .cbl-programmee { background: #E8F0FB; color: #1D4F99; }
.cbl-terminee { background: var(--cbl-soft); color: var(--cbl-muted); } .cbl-pause { background: #FBF0DE; color: #8A4E00; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .cbl-en_ligne { background: #12301F; color: #7BE0AA; }
  :root:where(:not([data-theme="light"])) .cbl-programmee { background: #142844; color: #9cc3ff; }
  :root:where(:not([data-theme="light"])) .cbl-pause { background: #2E2311; color: #EFA03A; } }
html[data-theme="dark"] .cbl-en_ligne { background: #12301F; color: #7BE0AA; } html[data-theme="dark"] .cbl-programmee { background: #142844; color: #9cc3ff; }
html[data-theme="dark"] .cbl-pause { background: #2E2311; color: #EFA03A; }
.cbl-thumb { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; display: block; }
.cbl-thumb-none { display: grid; place-items: center; background: var(--cbl-soft); color: var(--cbl-muted); font-weight: 700; }
.cbl-copy { width: 30em; max-width: 100%; }

/* dashboard */
.dashboard #content { width: auto; max-width: 1100px; }
.cbl-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 24px; }
.cbl-card { background: var(--cbl-surface); border: 1px solid var(--cbl-rule); border-radius: 14px; padding: 14px 16px; }
.cbl-card b { display: block; font-size: 28px; line-height: 1.1; color: var(--cbl-ink); font-variant-numeric: tabular-nums; }
.cbl-card span { color: var(--cbl-muted); font-size: 13px; }
.cbl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.cbl-actions a { display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 10px; background: var(--button-bg); color: #fff !important; font-weight: 600; }
.cbl-actions a.light { background: var(--cbl-soft); color: var(--cbl-ink) !important; }
.cbl-note { color: var(--cbl-muted); font-size: 13px; }
.cbl-warn { background: #FBF0DE; color: #6b4000; border-radius: 10px; padding: 10px 14px; }

/* the ad's form: fields on the left, the preview (as on the phone) on the right */
.cbl-edit { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.cbl-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) { .cbl-edit { grid-template-columns: 1fr; } .cbl-side { position: static; } }
.cbl-phone { background: var(--cbl-bg); border-radius: 22px; padding: 14px; border: 1px solid var(--cbl-rule); }
.cbl-phone h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--cbl-muted); background: none; padding: 0; }
.ad { background: var(--cbl-surface); border: 1px solid var(--cbl-rule); border-radius: 18px; overflow: hidden; font-family: -apple-system, system-ui, sans-serif; color: var(--cbl-ink); }
.ad .ad-img { aspect-ratio: 16 / 9; background: var(--cbl-soft) center / cover no-repeat; }
.ad-b { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; }
.ad-sp { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--cbl-muted); }
.ad-b b { font-size: 17px; font-weight: 600; }
.ad-b .sub { font-size: 14px; color: var(--cbl-muted); line-height: 1.35; }
.ad-ln { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ad-ln span { padding: 6px 11px; border-radius: 999px; background: var(--cbl-soft); font-size: 13px; font-weight: 600; }
.cbl-map { height: 260px; border-radius: 12px; border: 1px solid var(--cbl-rule); margin: 6px 0 4px; }
.cbl-map-tools { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--cbl-muted); }

/* charts */
.cbl-chart { width: 100%; height: auto; display: block; }
.cbl-chart .grid { stroke: var(--cbl-rule); stroke-width: 1; }
.cbl-chart text { fill: var(--cbl-muted); font-family: system-ui, sans-serif; }
.cbl-chart .s1 { fill: var(--cbl-s1); } .cbl-chart .s2 { fill: var(--cbl-s2); } .cbl-chart .zero { fill: var(--cbl-rule); }
.cbl-chart .hit { fill: transparent; } .cbl-chart g:hover rect:not(.hit) { opacity: .8; }
.cbl-legend { display: flex; gap: 16px; font-size: 13px; color: var(--cbl-muted); margin: 4px 0 8px; }
.cbl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cbl-legend .s1 { background: var(--cbl-s1); } .cbl-legend .s2 { background: var(--cbl-s2); }
.cbl-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--cbl-ink); color: var(--cbl-surface); font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; }
.cbl-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.cbl-panel { background: var(--cbl-surface); border: 1px solid var(--cbl-rule); border-radius: 14px; padding: 16px; margin-bottom: 20px; }
.cbl-panel h2 { margin: 0 0 4px; font-size: 16px; background: none; color: var(--cbl-ink); padding: 0; text-transform: none; letter-spacing: 0; }
.cbl-panel table { width: 100%; } .cbl-panel td.n, .cbl-panel th.n { text-align: right; font-variant-numeric: tabular-nums; }
.cbl-seg { display: inline-flex; background: var(--cbl-soft); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 16px; }
.cbl-seg a { padding: 6px 12px; border-radius: 8px; color: var(--cbl-ink) !important; font-weight: 600; }
.cbl-seg a.on { background: var(--cbl-surface); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
