/* The dashboard's shared stylesheet. base.html loads it after Darkly, so every page that extends
   base gets these rules; standalone pages link it themselves. Page-private styles stay in each
   template's extra_styles block, which base.html already wraps in a <style> element. */

[data-bs-theme=dark] {
  --cp-muted: #a0a6ab;
  --cp-field: #24272a;
  --cp-field-focus: #2a2e31;
  --cp-field-line: #3b4045;
  --cp-field-ink: #e9ecef;
  --cp-field-placeholder: #8a9096;
  --cp-accent: #00b894;
  --cp-accent-ring: rgba(0, 184, 148, .28);
}

/* Darkly's "secondary" is #444: 1.8:1 on the #181a1b page, so 309 text-secondary uses and every
   btn-outline-secondary (the most-used button) were close to invisible. */
[data-bs-theme=dark] .text-secondary {
  color: var(--cp-muted) !important;
}

[data-bs-theme=dark] .btn-outline-secondary {
  --bs-btn-color: #b8bec3;
  --bs-btn-border-color: #5b6166;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #4a5055;
  --bs-btn-hover-border-color: #6b7176;
  --bs-btn-focus-shadow-rgb: 107, 113, 118;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #4a5055;
  --bs-btn-active-border-color: #6b7176;
  --bs-btn-disabled-color: #6b7176;
  --bs-btn-disabled-border-color: #3b4045;
}

/* Darkly paints every field white with dark text: a bright slab in the navbar and on every
   form. Fields follow the page instead. */
[data-bs-theme=dark] .form-control,
[data-bs-theme=dark] .form-select {
  color: var(--cp-field-ink);
  background-color: var(--cp-field);
  border-color: var(--cp-field-line);
}

[data-bs-theme=dark] .form-control:focus,
[data-bs-theme=dark] .form-select:focus {
  color: var(--cp-field-ink);
  background-color: var(--cp-field-focus);
  border-color: var(--cp-accent);
  box-shadow: 0 0 0 .2rem var(--cp-accent-ring);
}

[data-bs-theme=dark] .form-control::placeholder {
  color: var(--cp-field-placeholder);
}

[data-bs-theme=dark] .form-control:disabled,
[data-bs-theme=dark] .form-select:disabled {
  color: var(--cp-field-placeholder);
  background-color: #1d2022;
}

/* Darkly draws the select arrow in #303030, invisible on a dark field. */
[data-bs-theme=dark] .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c8cdd1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

[data-bs-theme=dark] .input-group-text {
  color: #c8cdd1;
  background-color: #2a2e31;
  border-color: var(--cp-field-line);
}

[data-bs-theme=dark] .form-check-input:not(:checked) {
  background-color: var(--cp-field);
  border-color: #5b6166;
}

/* Darkly's bright alerts are solid fills (#f39c12, #e74c3c, #00bc8c, #3498db, #adb5bd). Muted
   text inside one takes dark ink: the page's grey on solid orange is unreadable. The dark fills
   (primary, secondary, dark) keep the grey. */
[data-bs-theme=dark] .alert-success :is(.text-muted, .text-secondary, .text-body-secondary),
[data-bs-theme=dark] .alert-info :is(.text-muted, .text-secondary, .text-body-secondary),
[data-bs-theme=dark] .alert-warning :is(.text-muted, .text-secondary, .text-body-secondary),
[data-bs-theme=dark] .alert-danger :is(.text-muted, .text-secondary, .text-body-secondary),
[data-bs-theme=dark] .alert-light :is(.text-muted, .text-secondary, .text-body-secondary) {
  color: rgba(24, 26, 27, .78) !important;
}

/* Flashes render once, at the top of the page content (partials/flashes.html). */
.cp-flashes .alert:last-child {
  margin-bottom: 1rem;
}

/* ==========================================================================
   The dashboard's design system (2026-10-03).
   Ground: the pressing-room black the operator set (#181a1b). Paper: warm inner-sleeve ink.
   One accent, the label green, used only to say where you are and what to press.
   Type: Archivo, served from the app; wide for titles, narrow with tabular figures for data.
   Archivo's ampersand is an "Et" that reads as a 3 in "Traffic & Revenue", so U+0026 is left
   out of its ranges and falls through to the system face.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/static/fonts/archivo-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-0025, U+0027-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/static/fonts/archivo-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Archivo";
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/static/fonts/archivo-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-0025, U+0027-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

[data-bs-theme=dark] {
  --cp-ground: #181a1b;
  --cp-sleeve: #202326;
  --cp-groove: #2a2e32;
  --cp-line: #30353a;
  --cp-line-strong: #3d4349;
  --cp-paper: #ebe8e1;
  --cp-smoke: #9aa1a7;
  --cp-link: #3fd2b0;
  --cp-link-hover: #7fe5cc;
  --cp-font: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;

  --bs-font-sans-serif: var(--cp-font);
  --bs-body-font-family: var(--cp-font);
  --bs-body-bg: var(--cp-ground);
  --bs-body-bg-rgb: 24, 26, 27;
  --bs-body-color: var(--cp-paper);
  --bs-body-color-rgb: 235, 232, 225;
  --bs-secondary-color: var(--cp-smoke);
  --bs-border-color: var(--cp-line);
  --bs-border-color-translucent: var(--cp-line);
  --bs-link-color: var(--cp-link);
  --bs-link-color-rgb: 63, 210, 176;
  --bs-link-hover-color: var(--cp-link-hover);
  --bs-link-hover-color-rgb: 127, 229, 204;
}

body {
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .h1, .h2, .h3 {
  font-stretch: 112%;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h4, h5, h6, .h4, .h5, .h6 {
  font-stretch: 104%;
  font-weight: 620;
}

/* Data reads in columns: narrow figures that line up. */
.table,
.dash-page .num {
  font-variant-numeric: tabular-nums;
}

.table {
  font-stretch: 94%;
}

.table > thead th {
  font-weight: 600;
  color: var(--cp-smoke);
}

[data-bs-theme=dark] .card {
  --bs-card-bg: var(--cp-sleeve);
  --bs-card-border-color: var(--cp-line);
  --bs-card-cap-bg: var(--cp-groove);
}

[data-bs-theme=dark] .dropdown-menu {
  --bs-dropdown-bg: var(--cp-sleeve);
  --bs-dropdown-border-color: var(--cp-line-strong);
  --bs-dropdown-divider-bg: var(--cp-line);
  --bs-dropdown-link-color: var(--cp-paper);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: var(--cp-groove);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-active-bg: var(--cp-groove);
  --bs-dropdown-header-color: var(--cp-smoke);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

[data-bs-theme=dark] .modal {
  --bs-modal-bg: var(--cp-sleeve);
  --bs-modal-border-color: var(--cp-line-strong);
}

/* --------------------------------------------------------------------------
   The top bar. The one bold gesture: the label-green disc, with grooves that
   fade out behind the menus.
   -------------------------------------------------------------------------- */

.cp-topbar {
  --bs-navbar-padding-y: .45rem;
  --bs-navbar-color: var(--cp-paper);
  --bs-navbar-hover-color: #fff;
  --bs-navbar-active-color: #fff;
  --bs-navbar-brand-color: var(--cp-paper);
  --bs-navbar-brand-hover-color: #fff;
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: var(--cp-sleeve);
  background-image: repeating-radial-gradient(circle at 34px 50%, rgba(255, 255, 255, .045) 0 1px, transparent 1px 6px);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 460px 3.6rem;
  border-bottom: 1px solid var(--cp-line);
}

.cp-topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 60px, var(--cp-sleeve) 460px);
}

.cp-topbar > .container-fluid {
  position: relative;
}

.cp-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-stretch: 118%;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

/* The hang-tag mark (static/favicon.svg, identical to the marketing site's images/mark.svg). */
.cp-brand-mark {
  width: 21px;
  height: 28px;
  flex: none;
}

.cp-sections .nav-link {
  font-weight: 500;
  border-radius: .4rem;
  padding: .45rem .7rem;
}

.cp-sections .nav-link i,
.cp-account .nav-link i {
  color: var(--cp-smoke);
  margin-right: .15rem;
}

.cp-sections .nav-link:hover,
.cp-sections .nav-link.show {
  background-color: var(--cp-groove);
}

@media (min-width: 992px) {
  .cp-sections .nav-link.active {
    box-shadow: inset 0 -2px 0 #00b894;
    border-radius: .4rem .4rem 0 0;
  }
}

.cp-menu {
  min-width: 15rem;
  padding: .35rem;
}

.cp-menu .dropdown-item {
  border-radius: .35rem;
  padding: .42rem .65rem;
}

.cp-menu .dropdown-item i {
  color: var(--cp-smoke) !important;
  width: 1.15rem;
  margin-right: .35rem;
}

.cp-menu .dropdown-item.active {
  background-color: var(--cp-groove);
  box-shadow: inset 2px 0 0 #00b894;
}

.cp-menu .dropdown-header {
  font-size: .78rem;
  font-weight: 600;
  padding: .55rem .65rem .25rem;
}

.cp-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: .35rem 0;
  flex: 0 1 19rem;
}

@media (min-width: 992px) {
  .cp-search {
    margin: 0 .5rem 0 .75rem;
  }
}

.cp-search > .bi-search {
  position: absolute;
  left: .7rem;
  color: var(--cp-smoke);
  pointer-events: none;
}

.cp-search .form-control {
  padding-left: 2.1rem;
  padding-right: 3.6rem;
  height: 2.2rem;
  font-size: .92rem;
  border-radius: .5rem;
}

.cp-search .form-control::-webkit-search-cancel-button {
  display: none;
}

.cp-kbd {
  position: absolute;
  right: .45rem;
  pointer-events: none;
}

@media (max-width: 991.98px) {
  .cp-search {
    flex-basis: auto;
    width: 100%;
  }

  .cp-search .cp-kbd {
    display: none;
  }
}

kbd.cp-kbd {
  font-family: var(--cp-font);
  font-size: .72rem;
  font-weight: 600;
  color: var(--cp-smoke);
  background: var(--cp-groove);
  border: 1px solid var(--cp-line-strong);
  border-radius: .3rem;
  padding: .05rem .35rem;
  box-shadow: none;
}

/* The page's one line of context, with the content it describes. */
.cp-context {
  color: var(--cp-smoke);
  font-size: .88rem;
  max-width: 92ch;
  margin: -.35rem 0 1rem;
}

.cp-footer {
  margin-top: 3rem;
  padding: 1rem 0;
  border-top: 1px solid var(--cp-line);
  color: var(--cp-smoke);
  font-size: .82rem;
}

.cp-footer .container-fluid {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.cp-footer nav {
  display: flex;
  gap: 1rem;
}

.cp-footer a {
  color: var(--cp-smoke);
  text-decoration: none;
}

.cp-footer a:hover {
  color: var(--cp-paper);
}

/* --------------------------------------------------------------------------
   The search palette.
   -------------------------------------------------------------------------- */

.cp-palette {
  width: min(680px, 94vw);
  margin: 11vh auto auto;
  padding: 0;
  color: var(--cp-paper);
  background: var(--cp-sleeve);
  border: 1px solid var(--cp-line-strong);
  border-radius: .75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
}

.cp-palette::backdrop {
  background: rgba(10, 11, 12, .62);
}

.cp-palette[open] {
  animation: cp-palette-in .14s ease-out;
}

@keyframes cp-palette-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.cp-palette-field {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--cp-line);
}

.cp-palette-field > .bi-search {
  position: absolute;
  left: 1rem;
  color: var(--cp-smoke);
}

.cp-palette-field input {
  width: 100%;
  padding: .95rem 3.5rem .95rem 2.6rem;
  color: var(--cp-paper);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 1.05rem;
}

.cp-palette-field input::-webkit-search-cancel-button {
  display: none;
}

.cp-palette-field .cp-kbd {
  right: .9rem;
}

.cp-palette-list {
  max-height: min(60vh, 30rem);
  overflow-y: auto;
  padding: .35rem;
}

.cp-palette-section {
  padding: .6rem .7rem .3rem;
  color: var(--cp-smoke);
  font-size: .78rem;
  font-weight: 600;
}

.cp-palette-option {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .5rem .7rem;
  border-radius: .45rem;
  color: var(--cp-paper);
  text-decoration: none;
}

.cp-palette-option > i {
  margin-top: .15rem;
  color: var(--cp-smoke);
}

.cp-palette-option[aria-selected="true"] {
  background: var(--cp-groove);
  box-shadow: inset 2px 0 0 #00b894;
  color: #fff;
}

.cp-palette-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.cp-palette-meta {
  flex: none;
  margin-top: .15rem;
  padding-left: .75rem;
  color: var(--cp-smoke);
  font-size: .78rem;
  white-space: nowrap;
}

.cp-palette-label {
  font-weight: 550;
}

.cp-palette-sub {
  color: var(--cp-smoke);
  font-size: .8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-stretch: 94%;
}

.cp-palette-empty,
.cp-palette-hint {
  color: var(--cp-smoke);
  font-size: .82rem;
  margin: 0;
  padding: .6rem 1rem;
}

.cp-palette-hint {
  border-top: 1px solid var(--cp-line);
}

/* Visible keyboard focus everywhere, in the accent. */
:focus-visible {
  outline: 2px solid #00b894;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cp-palette[open] {
    animation: none;
  }
}
