/* Tuned In plugin styles */
:root {
  --ti-ink: #1a2332;
  --ti-sea: #2c5f7c;
  --ti-mint: #3d8b7a;
  --ti-sand: #f0ebe3;
  --ti-coral: #c45c3e;
  --ti-pending: #e67e22;
  --ti-complete: #27ae60;
  --ti-scheduled: #1a5276;
  --ti-banned: #c0392b;
}

.ti-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  color: var(--ti-ink);
}

.ti-page-title {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ti-sea);
  margin: 0 0 0.25rem;
}

.ti-brand {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ti-sea);
  margin: 0;
}

.ti-sub {
  color: #5a6a7a;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.ti-nav .nav-link {
  color: var(--ti-sea);
  font-weight: 600;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
  border: 1px solid #d5dde5;
  background: #fff;
}

.ti-nav .nav-link.active {
  background: var(--ti-sea);
  border-color: var(--ti-sea);
  color: #fff;
}

.ti-card {
  background: linear-gradient(160deg, #fff 0%, var(--ti-sand) 140%);
  border: 1px solid #e0d8cc;
  border-radius: 6px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.ti-alert-review {
  border-left: 4px solid var(--ti-coral);
  background: #fdf2ef;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.ti-table thead th {
  background: var(--ti-ink);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.ti-table tbody tr:nth-child(even) {
  background: #f7f4ef;
}

.ti-mig-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.ti-mig-head h5 { margin: 0; }
.ti-mig-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.ti-mig-toolbar label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.ti-mig-toolbar select { margin-top: 0.2rem; }
.ti-mig-ok { color: #1e7a46; font-weight: 700; }
.ti-mig-pending { color: #9a6700; font-weight: 700; }

.ti-session-pick { position: relative; }
.ti-session-pick.is-open { z-index: 40; }
.ti-session-pick-btn {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block;
  width: 18.5rem;
  max-width: 70vw;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.3;
  padding: 0.28rem 1.35rem 0.28rem 0.55rem;
  cursor: pointer;
  text-align: left;
}
.ti-session-pick-btn:disabled { cursor: default; opacity: 0.7; }
.ti-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}
.ti-session-date { text-align: left; }
.ti-session-status {
  margin-left: auto;
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}
.ti-session-pick-btn .ti-session-row { padding-right: 0.15rem; }
.ti-session-pick-btn::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.ti-session-pick-menu {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 2px);
  width: 100%;
  max-height: 16rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 40;
  background: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
  box-sizing: border-box;
}
.ti-session-pick-menu.is-open { display: block; }
.ti-session-opt {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.3;
}
.ti-session-opt[aria-selected="true"] { box-shadow: inset 3px 0 0 currentColor; }
.ti-session-opt[aria-selected="true"] .ti-session-date { font-weight: 700; }
.ti-st-complete { background: #d5f5e3; color: #145c32; }
.ti-st-pending { background: #fff3cd; color: #7a5b00; }
.ti-st-scheduled { background: #d6e8f7; color: #1a4f7a; }
.ti-st-tbd { background: #eceff1; color: #455a64; }
.ti-st-holiday-unconfirmed,
.ti-st-holiday-confirmed { background: #f0e4fb; color: #5b2c6f; }

.ti-colour-list { display: flex; flex-direction: column; gap: 0.45rem; max-width: 42rem; }
.ti-colour-row { display: flex; align-items: center; gap: 0.65rem; margin: 0; font-weight: 600; }
.ti-colour-code {
  width: 6.6rem;
  flex: 0 0 auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid #d5dde6;
  border-radius: 0.45rem;
  padding: 0.35rem 0.45rem;
  background: #fff;
  color: #1c2430;
}
.ti-colour-code.is-invalid { border-color: #c0392b; }
.ti-colour-row input[type="color"] {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  cursor: pointer;
}
.ti-colour-sample {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 0.25rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
}
.ti-st-cancelled { background: #fadbd8; color: #7b241c; }
.ti-st-unknown { background: #f4f6f8; color: #243038; }

.ti-status-complete { background: #d5f5e3 !important; }
.ti-status-pending { background: #fdebd0 !important; }
.ti-status-scheduled { background: #d4e6f1 !important; color: #fff; }
.ti-status-cancelled { background: #fadbd8 !important; }

.ti-table tr.ti-toned > td { background: var(--ti-row) !important; }
.ti-status-cell { font-weight: 700; white-space: nowrap; color: var(--ti-ink); }
.ti-actions-cell { white-space: nowrap; }
.ti-actions-cell .ti-act + .ti-act { margin-left: 0.28rem; }
a.ti-act {
  display: inline-block;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  border: 1px solid transparent;
  vertical-align: middle;
}
a.ti-act:hover { text-decoration: none; }
a.ti-act-recount,
a.ti-act-recount:hover,
a.ti-act-recount:focus {
  background: #d6e8f7;
  color: #1a4f7a;
  border-color: #7eb0d4;
}
a.ti-act-edit,
a.ti-act-edit:hover,
a.ti-act-edit:focus {
  background: #1f8f4e;
  color: #fff;
}
a.ti-act-delete,
a.ti-act-delete:hover,
a.ti-act-delete:focus {
  background: #c0392b;
  color: #fff;
}
.ti-row-banned { background: #f5b7b1 !important; }
.ti-review-overdue { color: var(--ti-banned); font-weight: 700; }

.ti-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ti-stat {
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
  color: #fff;
}

.ti-stat .n { font-size: 1.5rem; font-weight: 700; display: block; }
.ti-stat .l { font-size: 0.75rem; opacity: 0.95; text-transform: uppercase; letter-spacing: 0.03em; }
.ti-stat-blue { background: #3498db; }
.ti-stat-green { background: #27ae60; }
.ti-stat-orange { background: #e67e22; }
.ti-stat-pink { background: #e84393; }
.ti-stat-grey { background: #7f8c8d; }
.ti-stat-red { background: #c0392b; }
.ti-stat-teal { background: var(--ti-mint); }

.ti-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.ti-toolbar .btn { white-space: nowrap; }

.ti-signin-sheet .ti-middle-col {
  display: none !important;
}
.ti-signin-sheet.ti-show-middle .ti-middle-col {
  display: table-cell !important;
}

@media print {
  .ti-nav, .ti-toolbar, .no-print, .ti-chrome-wrap, .ti-chrome-drawer, .ti-chrome-backdrop { display: none !important; }
  .ti-signin-sheet tr.ti-search-hide { display: table-row !important; }
  .ti-wrap { max-width: none; padding: 0; }
}

/* Site chrome — same bar pattern as My Ride Tracker, Tuned In colours */
html.ti-chrome-on {
  --ti-font: "Trebuchet MS", "Segoe UI", sans-serif;
  --ti-radius: 0.7rem;
  --bs-primary: var(--ti-sea);
  --bs-primary-rgb: 44, 95, 124;
  --bs-link-color: var(--ti-sea);
  --bs-link-hover-color: #1e4458;
}

html.ti-chrome-on body {
  background: #eef2f6;
  font-family: var(--ti-font);
  padding-top: 0 !important;
}

html.ti-chrome-on nav.navbar,
html.ti-chrome-on .navbar.navbar-expand-md,
html.ti-chrome-on .navbar.navbar-expand-lg,
html.ti-chrome-on .navbar.fixed-top,
html.ti-chrome-on .navbar.sticky-top,
html.ti-chrome-on header.navbar,
html.ti-chrome-on ul.us_menu,
html.ti-chrome-on .us_menu,
html.ti-chrome-on #footer.footer,
html.ti-chrome-on footer.footer {
  display: none !important;
}

html.ti-chrome-on .btn {
  border-radius: var(--ti-radius);
  font-weight: 700;
}

html.ti-chrome-on .btn-primary,
html.ti-chrome-on .btn.btn-primary {
  background-color: var(--ti-sea);
  border-color: var(--ti-sea);
}

html.ti-chrome-on .btn-primary:hover,
html.ti-chrome-on .btn.btn-primary:hover {
  background-color: #1e4458;
  border-color: #1e4458;
}

html.ti-chrome-on .ti-wrap {
  max-width: 1200px;
}

html.ti-chrome-on .ti-page-title,
html.ti-chrome-on .ti-brand {
  font-family: var(--ti-font);
  letter-spacing: -0.02em;
}

html.ti-chrome-on .ti-card {
  background: #fff;
  border: 1px solid #d5dde6;
  border-radius: var(--ti-radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html.ti-chrome-on .ti-table {
  background: #fff;
}

html.ti-chrome-on .ti-table thead th {
  background: #1c2430;
}

.ti-chrome-wrap {
  position: sticky;
  top: 0;
  z-index: 1070;
}

.ti-chrome {
  background: #fff;
  border-bottom: 1px solid #d5dde6;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #1c2430;
}

.ti-chrome-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: 3.35rem;
  padding: 0.45rem clamp(0.85rem, 2vw, 1.5rem);
}

.ti-chrome-brand {
  color: #1c2430;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
  white-space: nowrap;
}

.ti-chrome-brand:hover,
.ti-chrome-brand:focus {
  color: #3a5169;
  text-decoration: none;
}

.ti-chrome-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 0.35rem;
  min-width: 0;
  margin-left: 0.15rem;
  padding-left: 0.9rem;
  border-left: 1px solid #d5dde6;
}

.ti-chrome-link {
  color: #3a5169;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  white-space: nowrap;
}

.ti-chrome-link:hover,
.ti-chrome-link.is-current {
  color: #1c2430;
  background: #eef2f6;
  text-decoration: none;
}

.ti-chrome-link.is-current {
  color: var(--ti-sea, #2c5f7c);
}

.ti-chrome-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.ti-chrome-user {
  font-size: 0.88rem;
  font-weight: 700;
  color: #3a5169;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ti-chrome-logout {
  color: var(--ti-sea, #2c5f7c);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ti-chrome-logout:hover {
  color: #1c2430;
  text-decoration: none;
}

.ti-chrome-admin {
  position: relative;
}

.ti-chrome-admin > summary {
  list-style: none;
  cursor: pointer;
  color: var(--ti-sea, #2c5f7c);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.35rem 0.15rem;
  white-space: nowrap;
}

.ti-chrome-admin > summary::-webkit-details-marker {
  display: none;
}

.ti-chrome-admin > summary::after {
  content: "";
  display: inline-block;
  margin-left: 0.35rem;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: 0.12em;
}

.ti-chrome-admin > summary:hover,
.ti-chrome-admin[open] > summary,
.ti-chrome-admin > summary.is-current {
  color: #1c2430;
}

.ti-chrome-admin-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 11rem;
  background: #fff;
  border: 1px solid #d5dde6;
  border-radius: 0.7rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
  z-index: 1080;
}

.ti-chrome-admin-menu a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 0.45rem;
  color: #1c2430;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.ti-chrome-admin-menu a:hover,
.ti-chrome-admin-menu a.is-current {
  background: #eef2f6;
  color: var(--ti-sea, #2c5f7c);
  text-decoration: none;
}

.ti-signin-search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
}

.ti-signin-search label {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.ti-signin-search input[type="search"],
.ti-signin-search select {
  border: 1px solid #d5dde6;
  border-radius: 0.7rem;
  padding: 0.4rem 0.75rem;
  font: inherit;
  background: #fff;
}

.ti-signin-search input[type="search"] {
  width: min(22rem, 100%);
}

.ti-signin-search select {
  width: 9.5rem;
}

.ti-signin-middle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.25rem;
}

.ti-signin-search-count {
  color: #3a5169;
  font-size: 0.88rem;
  font-weight: 700;
}

.ti-signin-sheet tr.ti-search-hide {
  display: none;
}

.ti-signin-sheet tr.ti-signed > td,
.ti-signin-sheet tr.ti-signed-new > td,
.ti-signin-sheet tr.ti-signed-return > td {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ti-signin-sheet tr.ti-signed > td { background: #d8f5e3 !important; }
.ti-signin-sheet tr.ti-signed-new > td { background: #d6e8f7 !important; }
.ti-signin-sheet tr.ti-signed-return > td { background: #ffe0c2 !important; }

.ti-chrome-menu-btn {
  display: none;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid #d5dde6;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ti-chrome-menu-bars,
.ti-chrome-menu-bars::before,
.ti-chrome-menu-bars::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: #1c2430;
  border-radius: 1px;
  position: relative;
}

.ti-chrome-menu-bars::before,
.ti-chrome-menu-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.ti-chrome-menu-bars::before { top: -5px; }
.ti-chrome-menu-bars::after { top: 5px; }

.ti-chrome-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 1075;
}

.ti-chrome-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(20rem, 88vw);
  background: #fff;
  border-right: 1px solid #d5dde6;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.12);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.ti-chrome-drawer[hidden],
.ti-chrome-backdrop[hidden] {
  display: none !important;
}

.ti-chrome-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #d5dde6;
}

.ti-chrome-drawer-close {
  border: 0;
  background: transparent;
  color: #3a5169;
  font-weight: 700;
}

.ti-chrome-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 0.4rem;
  overflow: auto;
}

.ti-chrome-drawer-nav a {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 0.5rem;
  color: #1c2430;
  text-decoration: none;
  font-weight: 700;
}

.ti-chrome-drawer-nav a:hover,
.ti-chrome-drawer-nav a.is-current {
  background: #eef2f6;
  color: var(--ti-sea, #2c5f7c);
  text-decoration: none;
}

@media (max-width: 980px) {
  .ti-chrome-nav,
  .ti-chrome-user,
  .ti-chrome-admin,
  .ti-chrome-logout {
    display: none;
  }
  .ti-chrome-menu-btn {
    display: inline-flex;
  }
}
