/* FIX-59A-R2 extracted from app/templates/base.html first <style> block.
   Keep selectors unchanged.
   Loaded before theme-ewm.css so theme overrides still apply.
*/

    :root {
      --ewm-dark: #0F172A;
      --ewm-dark-2: #1E293B;
      --ewm-primary: #008BB8;
      --ewm-accent: #0D9488;
      --ewm-highlight: #00A7D8;
      --ewm-pink: var(--ewm-highlight); /* legacy alias */
      --ewm-soft: #F8FAFC;
      --ewm-line: #CBD5E1;
      --ewm-text: #111827;
    }

    body {
      background: var(--ewm-soft);
      color: var(--ewm-text);
    }

    .ewm-shell {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 285px 1fr;
    }

    .ewm-sidebar {
      background: #fff;
      border-right: 1px solid var(--ewm-line);
      position: sticky;
      top: 0;
      height: 100vh;
      overflow-y: auto;
      z-index: 1040;
    }

    .ewm-brand {
      height: 64px;
      padding: 12px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--ewm-line);
    }

    .ewm-brand-name {
      font-size: 18px;
      font-weight: 800;
      color: var(--ewm-text);
      line-height: 1.1;
    }

    .ewm-brand small {
      display: block;
      font-weight: 500;
      font-size: 11px;
      color: #697083;
    }

    .ewm-menu-section {
      border-bottom: 1px solid var(--ewm-line);
    }

    .ewm-menu-link,
    .ewm-menu-toggle {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 14px 16px;
      color: var(--ewm-text);
      text-decoration: none;
      background: #fff;
      border: 0;
      font-weight: 600;
      text-align: left;
    }

    .ewm-menu-link:hover,
    .ewm-menu-toggle:hover {
      background: #f0f3fa;
      color: var(--ewm-highlight);
    }

    .ewm-menu-icon {
      width: 24px;
      text-align: center;
      font-size: 17px;
    }

    .ewm-menu-arrow {
      margin-left: auto;
      opacity: .75;
    }

    .ewm-submenu {
      background: #f6f8fc;
      padding: 4px 0 8px 0;
    }

    .ewm-submenu a {
      display: block;
      padding: 10px 16px 10px 52px;
      color: #2c304a;
      text-decoration: none;
      font-size: 14px;
      border-left: 4px solid transparent;
    }

    .ewm-submenu a:hover {
      background: #eef2fb;
      border-left-color: var(--ewm-highlight);
      color: var(--ewm-highlight);
    }

    .ewm-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
    }

    .ewm-topbar {
      height: 64px;
      background: var(--ewm-dark);
      color: #fff;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 16px;
      position: sticky;
      top: 0;
      z-index: 1030;
    }

    .ewm-top-btn {
      width: 38px;
      height: 38px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      background: var(--ewm-dark-2);
      text-decoration: none;
      border: 1px solid #1E293B;
      font-size: 16px;
    }

    .ewm-top-btn:hover {
      color: #fff;
      background: #1E293B;
    }

    .ewm-top-spacer {
      flex: 1;
    }

    .ewm-user-chip {
      font-size: 13px;
      color: #dfe6ff;
      white-space: nowrap;
    }

    .ewm-content {
      padding: 24px;
      min-width: 0;
    }

    .ewm-mobile-menu {
      display: none;
    }

    .ewm-sidebar-close {
      display: none;
    }

    .alert-zone {
      background: #078a00;
      color: #fff;
      text-align: center;
      padding: 9px 16px;
      font-size: 14px;
      letter-spacing: .2px;
    }

    @media (max-width: 992px) {
      .ewm-shell {
        grid-template-columns: 1fr;
      }

      .ewm-sidebar {
        position: fixed;
        left: -310px;
        width: 285px;
        transition: left .2s ease;
        box-shadow: 10px 0 25px rgba(0,0,0,.18);
      }

      body.sidebar-open .ewm-sidebar {
        left: 0;
      }

      .ewm-mobile-menu {
        display: inline-flex;
      }

      .ewm-sidebar-close {
        display: inline-flex;
      }

      .ewm-content {
        padding: 16px;
      }
    }

    @media print {
      .ewm-sidebar,
      .ewm-topbar,
      .alert-zone {
        display: none !important;
      }

      .ewm-shell {
        display: block;
      }

      .ewm-content {
        padding: 0;
      }
    }
  
    .ewm-menu-link.active,
    .ewm-submenu a.active {
      background: #e9edf8 !important;
      color: #2563EB !important;
      border-left: 4px solid #2563EB !important;
      font-weight: 900 !important;
    }

    .ewm-menu-link.active {
      border-left: 4px solid #2563EB;
    }

      .ewm-settings-details {
        background: #fff;
      }

      .ewm-settings-details > summary {
        list-style: none;
        cursor: pointer;
      }

      .ewm-settings-details > summary::-webkit-details-marker {
        display: none;
      }

      .ewm-settings-details[open] .ewm-menu-arrow {
        transform: rotate(90deg);
      }

      .ewm-menu-toggle.active {
        background: #e9edf8 !important;
        color: #2563EB !important;
        border-left: 4px solid #2563EB !important;
        font-weight: 900 !important;
      }

  
      /* PHASE3H-C: desktop/mobile collapsible sidebar repair */
      .ewm-sidebar-toggle {
        display: inline-flex !important;
      }

      .ewm-shell {
        transition: grid-template-columns .22s ease;
      }

      body.sidebar-collapsed .ewm-shell {
        grid-template-columns: 0 minmax(0, 1fr) !important;
      }

      body.sidebar-collapsed .ewm-sidebar {
        transform: translateX(-285px) !important;
        pointer-events: none;
      }

      body.sidebar-collapsed .ewm-main {
        width: 100%;
      }

      @media (min-width: 993px) {
        .ewm-mobile-menu {
          display: inline-flex !important;
        }
      }

      @media (max-width: 992px) {
        body.sidebar-collapsed .ewm-shell,
        .ewm-shell {
          grid-template-columns: 1fr !important;
        }

        .ewm-sidebar {
          position: fixed !important;
          left: -310px;
          width: 285px;
          transform: none !important;
          transition: left .2s ease;
          box-shadow: 10px 0 25px rgba(0,0,0,.18);
        }

        body.sidebar-open .ewm-sidebar {
          left: 0 !important;
        }

        body.sidebar-collapsed .ewm-sidebar {
          left: -310px !important;
          transform: none !important;
        }
      }

    
      .ewm-logout-top {
        background: #1E293B;
      }

/* FIX-67B Provide-style blue/light-blue theme start */
:root {
  --provide-navy: #071827;
  --provide-navy-2: #0B2A3C;
  --provide-cyan: #008BB8;
  --provide-cyan-2: #00A7D8;
  --provide-light-blue: #E8F7FC;
  --provide-soft-blue: #F3FBFE;
  --provide-border: #C9EAF5;

  --ewm-primary-dark: var(--provide-navy);
  --ewm-primary-dark-2: var(--provide-navy-2);
  --ewm-primary: var(--provide-cyan);
  --ewm-highlight: var(--provide-cyan-2);
  --staff-primary: var(--provide-cyan);
  --staff-highlight: var(--provide-cyan-2);
  --bs-primary: var(--provide-cyan);
}

body {
  background:
    radial-gradient(circle at top left, rgba(0, 167, 216, .12), transparent 34rem),
    linear-gradient(180deg, #F7FCFE 0%, #EFF8FC 100%) !important;
  color: #172033 !important;
}

.app-shell,
.ewm-shell {
  background: transparent !important;
}

.app-topbar,
.ewm-topbar,
.topbar {
  background: #ffffff !important;
  border-bottom: 1px solid var(--provide-border) !important;
  color: var(--provide-navy) !important;
  box-shadow: 0 10px 30px rgba(7, 24, 39, .06) !important;
}

.app-sidebar,
.ewm-sidebar,
.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #F3FBFE 100%) !important;
  border-right: 1px solid var(--provide-border) !important;
  color: var(--provide-navy) !important;
  box-shadow: 12px 0 30px rgba(7, 24, 39, .06) !important;
}

.app-sidebar a,
.ewm-sidebar a,
.sidebar a {
  color: #13293D !important;
  border-radius: 12px !important;
}

.app-sidebar a:hover,
.ewm-sidebar a:hover,
.sidebar a:hover,
.app-sidebar a.active,
.ewm-sidebar a.active,
.sidebar a.active,
.app-sidebar .active > a,
.ewm-sidebar .active > a,
.sidebar .active > a {
  background: var(--provide-light-blue) !important;
  color: var(--provide-cyan) !important;
}

.btn-primary,
.btn-primary-action,
.btn-pink,
.task-pink-btn,
.task-primary-action,
.ops-icon-btn.primary,
.ops-icon-btn.pink {
  background: var(--provide-cyan) !important;
  border-color: var(--provide-cyan) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(0, 139, 184, .22) !important;
}

.btn-primary:hover,
.btn-primary-action:hover,
.btn-pink:hover,
.task-pink-btn:hover,
.task-primary-action:hover,
.ops-icon-btn.primary:hover,
.ops-icon-btn.pink:hover {
  background: #00779E !important;
  border-color: #00779E !important;
  color: #fff !important;
}

.btn-outline-primary {
  color: var(--provide-cyan) !important;
  border-color: var(--provide-cyan) !important;
}

.btn-outline-primary:hover {
  background: var(--provide-cyan) !important;
  border-color: var(--provide-cyan) !important;
  color: #fff !important;
}

.bg-primary,
.badge.bg-primary,
.text-bg-primary {
  background-color: var(--provide-cyan) !important;
}

.text-primary {
  color: var(--provide-cyan) !important;
}

.border-primary {
  border-color: var(--provide-cyan) !important;
}

.card {
  border: 1px solid rgba(201, 234, 245, .9) !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 45px rgba(7, 24, 39, .07) !important;
}

.card-header {
  background: linear-gradient(90deg, #F3FBFE 0%, #E8F7FC 100%) !important;
  border-bottom: 1px solid var(--provide-border) !important;
  color: var(--provide-navy) !important;
  font-weight: 800 !important;
}

.table thead th {
  background: #E8F7FC !important;
  color: #0B2A3C !important;
  border-bottom-color: #B8E3F1 !important;
}

.alert-info {
  background: #E8F7FC !important;
  border-color: #B8E3F1 !important;
  color: #0B2A3C !important;
}

/* Override old purple/pink hero strips without editing every template yet */
[class*="hero"],
[class*="banner"],
[class*="summary-card"].primary,
[class*="summary-card"].pink,
.dash-hero,
.hrdb-hero,
.venue-hero,
.roster-hero,
.event-hero {
  background: linear-gradient(135deg, #071827 0%, #0B2A3C 50%, #008BB8 100%) !important;
}

/* Event pages */
.events-page .card,
.event-page .card,
.allocation-page .card,
.rostering-page .card {
  border-color: var(--provide-border) !important;
}

.events-page h1,
.event-page h1,
.allocation-page h1,
.rostering-page h1 {
  color: var(--provide-navy) !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--provide-cyan) !important;
  box-shadow: 0 0 0 .2rem rgba(0, 139, 184, .16) !important;
}

/* Demo notice bar: keep clean but match client colour */
.demo-notice,
.alert-demo,
[class*="demo"] {
  background: #008BB8 !important;
  color: #fff !important;
}
/* FIX-67B Provide-style blue/light-blue theme end */

/* FIX-68A shell polish start */
:root {
  --shell-navy: #071827;
  --shell-navy-2: #0B2A3C;
  --shell-cyan: #008BB8;
  --shell-cyan-2: #00A7D8;
  --shell-soft: #E8F7FC;
  --shell-soft-2: #F3FBFE;
  --shell-border: #B8E3F1;
  --shell-muted: #64748B;
}

/* Overall shell */
.ewm-shell {
  background:
    radial-gradient(circle at top left, rgba(0,167,216,.13), transparent 34rem),
    linear-gradient(180deg, #F7FCFE 0%, #EFF8FC 100%) !important;
}

/* Sidebar container */
.ewm-sidebar {
  background: linear-gradient(180deg, #FFFFFF 0%, #F3FBFE 100%) !important;
  border-right: 1px solid var(--shell-border) !important;
  box-shadow: 12px 0 32px rgba(7,24,39,.07) !important;
}

/* Brand */
.ewm-brand {
  padding: 18px 16px 16px !important;
  border-bottom: 1px solid rgba(184,227,241,.85) !important;
  background:
    radial-gradient(circle at top right, rgba(0,167,216,.14), transparent 12rem),
    #FFFFFF !important;
}

.ewm-brand-name {
  color: var(--shell-navy) !important;
  font-weight: 950 !important;
  letter-spacing: .04em !important;
}

.ewm-brand small {
  color: var(--shell-muted) !important;
  font-weight: 700 !important;
}

/* Topbar */
.ewm-topbar {
  background: rgba(255,255,255,.96) !important;
  border-bottom: 1px solid var(--shell-border) !important;
  box-shadow: 0 12px 30px rgba(7,24,39,.06) !important;
  backdrop-filter: blur(10px);
}

.ewm-topbar strong,
.ewm-topbar .fw-bold,
.ewm-topbar .brand,
.ewm-topbar-title {
  color: var(--shell-navy) !important;
}

/* Menu groups */
.ewm-menu-group {
  margin-bottom: 10px !important;
}

.ewm-menu-section,
.ewm-menu-label {
  color: #0B2A3C !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

/* Main links */
.ewm-menu-link,
.ewm-nav-link,
.ewm-submenu a,
.ewm-menu-toggle {
  color: #13293D !important;
  border-radius: 14px !important;
  border: 1px solid transparent !important;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease !important;
}

.ewm-menu-link:hover,
.ewm-nav-link:hover,
.ewm-submenu a:hover,
.ewm-menu-toggle:hover {
  background: #E8F7FC !important;
  border-color: #B8E3F1 !important;
  color: var(--shell-cyan) !important;
  transform: translateX(2px);
}

/* Active states */
.ewm-menu-link.active,
.ewm-nav-link.active,
.ewm-submenu a.active,
.ewm-menu-toggle.active,
.ewm-sidebar a.active,
.ewm-sidebar .active > a {
  background: linear-gradient(135deg, #E8F7FC 0%, #F3FBFE 100%) !important;
  border: 1px solid #B8E3F1 !important;
  border-left: 5px solid var(--shell-cyan) !important;
  color: var(--shell-cyan) !important;
  font-weight: 900 !important;
  box-shadow: 0 10px 22px rgba(0,139,184,.10) !important;
}

/* Icons/badges inside menu */
.ewm-menu-link .icon,
.ewm-nav-link .icon,
.ewm-menu-link span:first-child,
.ewm-nav-link span:first-child {
  color: inherit !important;
}

/* Quick links */
.ewm-nav-link[href*="quick-create"],
a[href="/events/quick-create"] {
  background: linear-gradient(135deg, #008BB8 0%, #00A7D8 100%) !important;
  border-color: #008BB8 !important;
  color: #FFFFFF !important;
  font-weight: 900 !important;
  box-shadow: 0 12px 26px rgba(0,139,184,.22) !important;
}

.ewm-nav-link[href*="quick-create"]:hover,
a[href="/events/quick-create"]:hover {
  background: linear-gradient(135deg, #00779E 0%, #008BB8 100%) !important;
  color: #FFFFFF !important;
}

/* Buttons in shell */
.ewm-top-btn,
.ewm-sidebar-toggle,
.ewm-sidebar-close {
  border: 1px solid #B8E3F1 !important;
  background: #FFFFFF !important;
  color: #0B2A3C !important;
  border-radius: 12px !important;
}

.ewm-top-btn:hover,
.ewm-sidebar-toggle:hover,
.ewm-sidebar-close:hover {
  background: #E8F7FC !important;
  color: #008BB8 !important;
}

/* Content spacing */
.ewm-main {
  background: transparent !important;
}

.ewm-content,
main.ewm-content {
  padding-top: 18px !important;
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
  .ewm-sidebar {
    border-radius: 0 22px 22px 0 !important;
  }

  body.sidebar-open::before {
    background: rgba(7,24,39,.36) !important;
    backdrop-filter: blur(2px);
  }
}

/* Keep old alias classes blue instead of pink */
.btn-pink,
.task-pink-btn,
.ops-icon-btn.pink {
  background: #008BB8 !important;
  border-color: #008BB8 !important;
  color: #FFFFFF !important;
}

.btn-pink:hover,
.task-pink-btn:hover,
.ops-icon-btn.pink:hover {
  background: #00779E !important;
  border-color: #00779E !important;
}
/* FIX-68A shell polish end */

/* FIX-68A-R4 sidebar font consistency start */
.ewm-sidebar,
.ewm-sidebar nav,
.ewm-sidebar a,
.ewm-sidebar summary,
.ewm-menu-link,
.ewm-nav-link,
.ewm-menu-toggle,
.ewm-submenu a {
  font-family: inherit !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  letter-spacing: .005em !important;
}

.ewm-menu-link,
.ewm-nav-link,
.ewm-menu-toggle {
  font-weight: 760 !important;
}

.ewm-submenu a,
.ewm-sidebar details a,
.ewm-sidebar .nav-link {
  font-weight: 720 !important;
}

.ewm-menu-link span:last-child,
.ewm-nav-link span:last-child,
.ewm-menu-toggle span:last-child {
  font-weight: inherit !important;
}

.ewm-menu-link.active,
.ewm-nav-link.active,
.ewm-menu-toggle.active,
.ewm-submenu a.active,
.ewm-sidebar details a.active,
.ewm-sidebar .nav-link.active {
  font-weight: 880 !important;
}

.ewm-sidebar .ewm-menu-section,
.ewm-sidebar .ewm-menu-label,
.ewm-sidebar .small,
.ewm-sidebar small {
  font-weight: 850 !important;
  letter-spacing: .075em !important;
}

.ewm-brand-name {
  font-weight: 950 !important;
  letter-spacing: .035em !important;
}

.ewm-brand small {
  font-weight: 700 !important;
  letter-spacing: .01em !important;
}
/* FIX-68A-R4 sidebar font consistency end */

/* FIX-68B-1 venue/site visual polish start */
body:has(a[href="/venues/"]),
body:has(a[href*="/venues/"]) {
  --venue-navy: #071827;
  --venue-deep: #0B2A3C;
  --venue-blue: #008BB8;
  --venue-sky: #00A7D8;
  --venue-soft: #EEF8FC;
  --venue-border: rgba(11, 42, 60, .12);
}

/* Page heading area */
body:has(a[href="/venues/"]) h1,
body:has(a[href*="/venues/"]) h1,
body:has(a[href="/venues/"]) .h1,
body:has(a[href*="/venues/"]) .h1,
body:has(a[href="/venues/"]) .h3,
body:has(a[href*="/venues/"]) .h3,
body:has(a[href="/venues/"]) .h4,
body:has(a[href*="/venues/"]) .h4 {
  color: var(--venue-navy) !important;
  font-weight: 900 !important;
  letter-spacing: -.025em !important;
}

/* Venue cards */
body:has(a[href="/venues/"]) .card,
body:has(a[href*="/venues/"]) .card,
body:has(a[href="/venues/"]) .settings-card,
body:has(a[href*="/venues/"]) .settings-card,
body:has(a[href="/venues/"]) .g47-attendance-card,
body:has(a[href*="/venues/"]) .g47-attendance-card {
  border: 1px solid var(--venue-border) !important;
  border-radius: 18px !important;
  box-shadow: 0 14px 36px rgba(7, 24, 39, .08) !important;
  overflow: hidden !important;
  background: #fff !important;
}

/* Card headers */
body:has(a[href="/venues/"]) .card-header,
body:has(a[href*="/venues/"]) .card-header,
body:has(a[href="/venues/"]) .settings-card-header,
body:has(a[href*="/venues/"]) .settings-card-header,
body:has(a[href="/venues/"]) .g47-card-title,
body:has(a[href*="/venues/"]) .g47-card-title {
  background: linear-gradient(135deg, rgba(0, 139, 184, .12), rgba(0, 167, 216, .06)) !important;
  color: var(--venue-navy) !important;
  border-bottom: 1px solid var(--venue-border) !important;
  font-weight: 900 !important;
  letter-spacing: -.01em !important;
}

/* Tables */
body:has(a[href="/venues/"]) table,
body:has(a[href*="/venues/"]) table {
  border-radius: 14px !important;
  overflow: hidden !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

body:has(a[href="/venues/"]) thead th,
body:has(a[href*="/venues/"]) thead th,
body:has(a[href="/venues/"]) .table thead th,
body:has(a[href*="/venues/"]) .table thead th {
  background: #F2FAFD !important;
  color: var(--venue-deep) !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  font-weight: 900 !important;
  border-bottom: 1px solid var(--venue-border) !important;
}

body:has(a[href="/venues/"]) tbody td,
body:has(a[href*="/venues/"]) tbody td {
  vertical-align: middle !important;
  color: #20313f !important;
}

/* Buttons */
body:has(a[href="/venues/"]) .btn,
body:has(a[href*="/venues/"]) .btn {
  border-radius: 999px !important;
  font-weight: 800 !important;
  letter-spacing: .005em !important;
}

body:has(a[href="/venues/"]) .btn-primary,
body:has(a[href*="/venues/"]) .btn-primary,
body:has(a[href="/venues/"]) .btn-success,
body:has(a[href*="/venues/"]) .btn-success {
  background: linear-gradient(135deg, var(--venue-blue), var(--venue-sky)) !important;
  border-color: transparent !important;
  box-shadow: 0 10px 24px rgba(0, 139, 184, .22) !important;
}

body:has(a[href="/venues/"]) .btn-outline-primary,
body:has(a[href*="/venues/"]) .btn-outline-primary {
  border-color: rgba(0, 139, 184, .45) !important;
  color: var(--venue-blue) !important;
}

body:has(a[href="/venues/"]) .btn-outline-primary:hover,
body:has(a[href*="/venues/"]) .btn-outline-primary:hover {
  background: var(--venue-blue) !important;
  color: #fff !important;
}

/* Tabs / nav pills used on site detail */
body:has(a[href="/venues/"]) .nav-tabs,
body:has(a[href*="/venues/"]) .nav-tabs {
  border-bottom: 1px solid var(--venue-border) !important;
  gap: 6px !important;
}

body:has(a[href="/venues/"]) .nav-tabs .nav-link,
body:has(a[href*="/venues/"]) .nav-tabs .nav-link,
body:has(a[href="/venues/"]) .nav-pills .nav-link,
body:has(a[href*="/venues/"]) .nav-pills .nav-link {
  border-radius: 999px !important;
  font-weight: 850 !important;
  color: var(--venue-deep) !important;
  border: 1px solid transparent !important;
}

body:has(a[href="/venues/"]) .nav-tabs .nav-link.active,
body:has(a[href*="/venues/"]) .nav-tabs .nav-link.active,
body:has(a[href="/venues/"]) .nav-pills .nav-link.active,
body:has(a[href*="/venues/"]) .nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--venue-blue), var(--venue-sky)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* Forms */
body:has(a[href="/venues/"]) .form-label,
body:has(a[href*="/venues/"]) .form-label,
body:has(a[href="/venues/"]) label,
body:has(a[href*="/venues/"]) label {
  color: var(--venue-deep) !important;
  font-weight: 800 !important;
}

body:has(a[href="/venues/"]) .form-control,
body:has(a[href*="/venues/"]) .form-control,
body:has(a[href="/venues/"]) .form-select,
body:has(a[href*="/venues/"]) .form-select {
  border-radius: 12px !important;
  border-color: rgba(11, 42, 60, .18) !important;
}

body:has(a[href="/venues/"]) .form-control:focus,
body:has(a[href*="/venues/"]) .form-control:focus,
body:has(a[href="/venues/"]) .form-select:focus,
body:has(a[href*="/venues/"]) .form-select:focus {
  border-color: var(--venue-sky) !important;
  box-shadow: 0 0 0 .2rem rgba(0, 167, 216, .16) !important;
}

/* Badges and small meta */
body:has(a[href="/venues/"]) .badge,
body:has(a[href*="/venues/"]) .badge {
  border-radius: 999px !important;
  font-weight: 850 !important;
  letter-spacing: .02em !important;
}

body:has(a[href="/venues/"]) .text-muted,
body:has(a[href*="/venues/"]) .text-muted {
  color: #5d7080 !important;
}

/* Venue detail heavy page spacing */
body:has(a[href*="/venues/"]) .container-fluid,
body:has(a[href*="/venues/"]) .container {
  max-width: none !important;
}

body:has(a[href*="/venues/"]) .tab-content {
  padding-top: 14px !important;
}

body:has(a[href*="/venues/"]) .alert-info,
body:has(a[href*="/venues/"]) .alert-primary {
  border-radius: 16px !important;
  border: 1px solid rgba(0, 139, 184, .18) !important;
  background: linear-gradient(135deg, #F1FAFD, #FFFFFF) !important;
  color: var(--venue-deep) !important;
}

/* Print QR card */
body:has(code) img[alt="Attendance QR"] {
  border-radius: 18px !important;
  border: 10px solid #fff !important;
  box-shadow: 0 18px 45px rgba(7, 24, 39, .16) !important;
}

/* FIX-68B-1 venue/site visual polish end */

/* FIX-68B-1A softer venue highlights start */

/* Softer active tabs / pills */
body:has(a[href="/venues/"]) .nav-tabs .nav-link.active,
body:has(a[href*="/venues/"]) .nav-tabs .nav-link.active,
body:has(a[href="/venues/"]) .nav-pills .nav-link.active,
body:has(a[href*="/venues/"]) .nav-pills .nav-link.active {
  background: linear-gradient(135deg, #EAF8FD, #F7FCFE) !important;
  color: #0B2A3C !important;
  border: 1px solid rgba(0, 139, 184, .28) !important;
  box-shadow: 0 8px 18px rgba(0, 139, 184, .10) !important;
}

/* Softer primary action buttons on venue pages */
body:has(a[href="/venues/"]) .btn-primary,
body:has(a[href*="/venues/"]) .btn-primary,
body:has(a[href="/venues/"]) .btn-success,
body:has(a[href*="/venues/"]) .btn-success {
  background: linear-gradient(135deg, #008BB8, #28B7DE) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(0, 139, 184, .16) !important;
}

/* Softer card header highlight */
body:has(a[href="/venues/"]) .card-header,
body:has(a[href*="/venues/"]) .card-header,
body:has(a[href="/venues/"]) .settings-card-header,
body:has(a[href*="/venues/"]) .settings-card-header,
body:has(a[href="/venues/"]) .g47-card-title,
body:has(a[href*="/venues/"]) .g47-card-title {
  background: linear-gradient(135deg, #F4FBFE, #FFFFFF) !important;
  color: #071827 !important;
  border-bottom: 1px solid rgba(11, 42, 60, .10) !important;
}

/* Softer table heading */
body:has(a[href="/venues/"]) thead th,
body:has(a[href*="/venues/"]) thead th,
body:has(a[href="/venues/"]) .table thead th,
body:has(a[href*="/venues/"]) .table thead th {
  background: #F7FCFE !important;
  color: #0B2A3C !important;
}

/* Non-active tabs should be calm and readable */
body:has(a[href="/venues/"]) .nav-tabs .nav-link,
body:has(a[href*="/venues/"]) .nav-tabs .nav-link,
body:has(a[href="/venues/"]) .nav-pills .nav-link,
body:has(a[href*="/venues/"]) .nav-pills .nav-link {
  background: #FFFFFF !important;
  color: #344B5A !important;
  border: 1px solid rgba(11, 42, 60, .10) !important;
}

body:has(a[href="/venues/"]) .nav-tabs .nav-link:hover,
body:has(a[href*="/venues/"]) .nav-tabs .nav-link:hover,
body:has(a[href="/venues/"]) .nav-pills .nav-link:hover,
body:has(a[href*="/venues/"]) .nav-pills .nav-link:hover {
  background: #F2FAFD !important;
  color: #0B2A3C !important;
  border-color: rgba(0, 139, 184, .22) !important;
}

/* FIX-68B-1A softer venue highlights end */

/* FIX-68B-1B formal C247-style venue start */

/*
  Formal C247-style tuning:
  - restrained corporate blue
  - no flashy active fills
  - flatter buttons
  - white/light-grey card headers
*/

body:has(a[href="/venues/"]),
body:has(a[href*="/venues/"]) {
  --venue-formal-navy: #102A43;
  --venue-formal-text: #243B53;
  --venue-formal-muted: #6B7C93;
  --venue-formal-line: #D9E2EC;
  --venue-formal-soft: #F7FAFC;
  --venue-formal-blue: #1B75BB;
  --venue-formal-blue-dark: #155E95;
}

/* Formal cards: less shadow, less rounded, more corporate */
body:has(a[href="/venues/"]) .card,
body:has(a[href*="/venues/"]) .card,
body:has(a[href="/venues/"]) .settings-card,
body:has(a[href*="/venues/"]) .settings-card,
body:has(a[href="/venues/"]) .g47-attendance-card,
body:has(a[href*="/venues/"]) .g47-attendance-card {
  border: 1px solid var(--venue-formal-line) !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(16, 42, 67, .06) !important;
  background: #fff !important;
}

/* Formal headers: mostly white/grey, no blue glow */
body:has(a[href="/venues/"]) .card-header,
body:has(a[href*="/venues/"]) .card-header,
body:has(a[href="/venues/"]) .settings-card-header,
body:has(a[href*="/venues/"]) .settings-card-header,
body:has(a[href="/venues/"]) .g47-card-title,
body:has(a[href*="/venues/"]) .g47-card-title {
  background: #F7FAFC !important;
  color: var(--venue-formal-navy) !important;
  border-bottom: 1px solid var(--venue-formal-line) !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

/* Page titles */
body:has(a[href="/venues/"]) h1,
body:has(a[href*="/venues/"]) h1,
body:has(a[href="/venues/"]) .h1,
body:has(a[href*="/venues/"]) .h1,
body:has(a[href="/venues/"]) .h3,
body:has(a[href*="/venues/"]) .h3,
body:has(a[href="/venues/"]) .h4,
body:has(a[href*="/venues/"]) .h4 {
  color: var(--venue-formal-navy) !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

/* Formal buttons: same shape/style across venue pages */
body:has(a[href="/venues/"]) .btn,
body:has(a[href*="/venues/"]) .btn {
  border-radius: 6px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
  padding-left: .85rem !important;
  padding-right: .85rem !important;
}

/* Primary buttons: flat corporate blue, not gradient */
body:has(a[href="/venues/"]) .btn-primary,
body:has(a[href*="/venues/"]) .btn-primary,
body:has(a[href="/venues/"]) .btn-success,
body:has(a[href*="/venues/"]) .btn-success {
  background: var(--venue-formal-blue) !important;
  border-color: var(--venue-formal-blue) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body:has(a[href="/venues/"]) .btn-primary:hover,
body:has(a[href*="/venues/"]) .btn-primary:hover,
body:has(a[href="/venues/"]) .btn-success:hover,
body:has(a[href*="/venues/"]) .btn-success:hover {
  background: var(--venue-formal-blue-dark) !important;
  border-color: var(--venue-formal-blue-dark) !important;
  color: #fff !important;
}

/* Outline buttons: plain and formal */
body:has(a[href="/venues/"]) .btn-outline-primary,
body:has(a[href*="/venues/"]) .btn-outline-primary {
  background: #fff !important;
  border-color: var(--venue-formal-blue) !important;
  color: var(--venue-formal-blue) !important;
}

body:has(a[href="/venues/"]) .btn-outline-primary:hover,
body:has(a[href*="/venues/"]) .btn-outline-primary:hover {
  background: var(--venue-formal-blue) !important;
  border-color: var(--venue-formal-blue) !important;
  color: #fff !important;
}

body:has(a[href="/venues/"]) .btn-outline-secondary,
body:has(a[href*="/venues/"]) .btn-outline-secondary {
  background: #fff !important;
  border-color: #BCCCDC !important;
  color: var(--venue-formal-text) !important;
}

body:has(a[href="/venues/"]) .btn-outline-secondary:hover,
body:has(a[href*="/venues/"]) .btn-outline-secondary:hover {
  background: #F0F4F8 !important;
  color: var(--venue-formal-navy) !important;
}

/* Active tabs: no filled blue; formal underline / border */
body:has(a[href="/venues/"]) .nav-tabs,
body:has(a[href*="/venues/"]) .nav-tabs {
  border-bottom: 1px solid var(--venue-formal-line) !important;
  gap: 0 !important;
}

body:has(a[href="/venues/"]) .nav-tabs .nav-link,
body:has(a[href*="/venues/"]) .nav-tabs .nav-link,
body:has(a[href="/venues/"]) .nav-pills .nav-link,
body:has(a[href*="/venues/"]) .nav-pills .nav-link {
  background: transparent !important;
  color: var(--venue-formal-text) !important;
  border: 1px solid transparent !important;
  border-radius: 6px 6px 0 0 !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

body:has(a[href="/venues/"]) .nav-tabs .nav-link:hover,
body:has(a[href*="/venues/"]) .nav-tabs .nav-link:hover,
body:has(a[href="/venues/"]) .nav-pills .nav-link:hover,
body:has(a[href*="/venues/"]) .nav-pills .nav-link:hover {
  background: #F7FAFC !important;
  color: var(--venue-formal-navy) !important;
  border-color: #E6EEF5 !important;
}

/* This is the key: active tab is white, blue top/bottom signal only */
body:has(a[href="/venues/"]) .nav-tabs .nav-link.active,
body:has(a[href*="/venues/"]) .nav-tabs .nav-link.active,
body:has(a[href="/venues/"]) .nav-pills .nav-link.active,
body:has(a[href*="/venues/"]) .nav-pills .nav-link.active {
  background: #FFFFFF !important;
  color: var(--venue-formal-blue-dark) !important;
  border-color: var(--venue-formal-line) var(--venue-formal-line) #FFFFFF !important;
  border-top: 3px solid var(--venue-formal-blue) !important;
  box-shadow: none !important;
}

/* Tables: formal grey header */
body:has(a[href="/venues/"]) thead th,
body:has(a[href*="/venues/"]) thead th,
body:has(a[href="/venues/"]) .table thead th,
body:has(a[href*="/venues/"]) .table thead th {
  background: #F0F4F8 !important;
  color: var(--venue-formal-navy) !important;
  border-bottom: 1px solid var(--venue-formal-line) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .025em !important;
}

/* Forms */
body:has(a[href="/venues/"]) .form-control,
body:has(a[href*="/venues/"]) .form-control,
body:has(a[href="/venues/"]) .form-select,
body:has(a[href*="/venues/"]) .form-select {
  border-radius: 6px !important;
  border-color: #BCCCDC !important;
}

body:has(a[href="/venues/"]) .form-control:focus,
body:has(a[href*="/venues/"]) .form-control:focus,
body:has(a[href="/venues/"]) .form-select:focus,
body:has(a[href*="/venues/"]) .form-select:focus {
  border-color: var(--venue-formal-blue) !important;
  box-shadow: 0 0 0 .15rem rgba(27, 117, 187, .15) !important;
}

/* Muted text */
body:has(a[href="/venues/"]) .text-muted,
body:has(a[href*="/venues/"]) .text-muted {
  color: var(--venue-formal-muted) !important;
}

/* Alerts: formal info panel */
body:has(a[href*="/venues/"]) .alert-info,
body:has(a[href*="/venues/"]) .alert-primary {
  background: #F7FAFC !important;
  border: 1px solid var(--venue-formal-line) !important;
  color: var(--venue-formal-text) !important;
  border-radius: 8px !important;
}

/* FIX-68B-1B formal C247-style venue end */
