/* Citations New - Bus autocomplete */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #D0DCE8;
    border-top: none;
    border-radius: 0 0 8px 8px;
    display: none;
    box-shadow: 0 4px 8px rgba(4,44,83,.12);
}

.autocomplete-list.is-visible {
    display: block;
}

.autocomplete-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 13px;
    color: #042C53;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
    background: #042C53;
    color: #fff;
}

.route-num-header {
    font-weight: 700;
    background: #F0F4F8;
    color: #042C53;
    border-top: 1px solid #D0DCE8;
}

.route-num-header:first-child {
    border-top: none;
}

.route-num-header:hover,
.route-num-header.is-active {
    background: #042C53;
    color: #fff;
}

.route-line-item {
    padding-left: 1.75rem;
}

/* ---- Navigation ---- */

.logo-icon {
    background: #042C53;
    overflow: hidden;
    border-radius: 8px;
}

.logo-icon-inner {
    border: 1px #B5D4F4 solid;
}

.nav-title {
    color: #042C53;
    font-size: 18px;
    font-weight: 500;
    word-wrap: break-word;
}

.nav-link {
    color: #9BAFC0;
    font-size: 13px;
    font-weight: 400;
    word-wrap: break-word;
}

.nav-link-active {
    color: #042C53;
    font-size: 13px;
    font-weight: 500;
    word-wrap: break-word;
}

.user-avatar {
    background: #E6F1FB;
    overflow: hidden;
    border-radius: 15px;
}

.user-initials {
    color: #0C447C;
    font-size: 13px;
    font-weight: 500;
    word-wrap: break-word;
}

/* ---- Header Banner ---- */
.header-text-container {
    flex-grow: 2;
}

.header-banner {
    background: #042C53;
    overflow: hidden;
    border-radius: 12px;
    width: 100%; 
    height: 5rem; 
    display: flex; 
    justify-content: space-between;
}

.header-title {
    color: #E6F1FB;
    font-size: 22px;
    font-weight: 500;
    word-wrap: break-word;
    margin-left: 2rem; 
    margin-top: 0.6rem;
}

.header-subtitle {
    color: white;
    font-size: 13px;
    font-weight: 400;
    word-wrap: break-word;
    margin-left: 2rem;
}

/* Stat Cards */
.header-stats-container {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    flex-grow: 1;
}

.stat-card {
    background: rgba(55, 138, 221, 0.15);
    overflow: hidden;
    border-radius: 8px;
    outline: 1px rgba(55, 138, 221, 0.25) solid;
    outline-offset: -1px;
    width: 9rem; 
    height: 3.6rem; 
    margin-top: 0.6rem;
}

.stat-value {
    color: #E6F1FB;
    font-size: 20px;
    font-weight: 500;
    word-wrap: break-word;
    margin-left: 0.75rem;
}

.stat-label {
    color: #85B7EB;
    font-size: 12px;
    font-weight: 400;
    word-wrap: break-word;
    margin-left: 0.75rem;
}

/* ---- Search Panel ---- */

.search-panel {
    background: white;
    overflow: visible;
    border-radius: 12px;
    outline: 1px #D8E4EE solid;
    outline-offset: -1px;
    width: 100%;
    min-height: 15rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
}

.input-filters-container {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem;
    width: 100%;
    gap: 1rem;
}

.input-filters-element-container {
    flex: 0 0 calc(25% - 0.75rem);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 200px;
}

.input-pills-container {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.evasion-mode-filters-container {
    display: flex;
    gap: 0.4rem;
}

.field-label {
    color: #042C53;
    font-size: 13px;
    font-weight: 500;
    word-wrap: break-word;
    height: auto;
    margin-bottom: 0.25rem;
    flex-grow: 0;
}

.field-input {
    background: #F0F4F8;
    overflow: visible;
    border-radius: 8px;
    outline: 1px #D0DCE8 solid;
    outline-offset: -1px;
    height: 2.5rem;
    min-width: 200px;
    display: flex;
    align-items: center;
}

.field-placeholder {
    color: #9BAFC0;
    font-size: 13px;
    font-weight: 400;
    word-wrap: break-word;
    margin-left: 1rem;
}

/* Filter Pills */

.filter-group-pills-container {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.filter-group-label {
    color: #042C53;
    font-size: 12px;
    font-weight: 500;
    word-wrap: break-word;
}

.pill-active-text {
    color: white;
    font-size: 12px;
    font-weight: 400;
    word-wrap: break-word;
}

.pill-active-count {
    color: white;
    font-size: 10px;
    font-weight: 400;
    word-wrap: break-word;
}

.pill-active {
    background: #042C53;
    overflow: hidden;
    border-radius: 999px;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    padding: 0 0.75rem;
    cursor: pointer;
    transition: background 0.2s, outline 0.2s;
}

.pill {
    background: white;
    overflow: hidden;
    border-radius: 999px;
    outline-offset: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    padding: 0 0.75rem;
    min-width: auto;
    cursor: pointer;
    transition: background 0.2s, outline 0.2s;
}

.pill-text {
    color: #4A6275;
    font-size: 12px;
    font-weight: 400;
    word-wrap: break-word;
}

.pill-count {
    color: #4A6275;
    font-size: 10px;
    font-weight: 400;
    word-wrap: break-word;
}

/* Action Buttons */
.action-buttons-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pill > div,
.pill-active > div {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-search {
    background: #042C53;
    overflow: hidden;
    outline: 1px #D8E4EE solid;
    outline-offset: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-search-text {
    color: #B5D4F4;
    font-size: 13px;
    font-weight: 400;
    word-wrap: break-word;
}

.btn-clear {
    background: white;
    overflow: hidden;
    outline: 1px #D0DCE8 solid;
    outline-offset: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-clear-text {
  color: #4A6275;
  font-size: 13px;
  font-weight: 400;
  word-wrap: break-word;
}

.btn-search:hover {
    opacity: 0.9;
}

.btn-clear:hover {
    background: #f5f7fa;
}

/* ---- Results Panel ---- */

.results-panel {
    overflow: hidden;
    border-radius: 12px;
    outline: 1px #D8E4EE solid;
    outline-offset: -1px;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    margin-top: 1rem;
}

.results-count {
  color: #1A2A3A;
  font-size: 14px;
  font-weight: 500;
  word-wrap: break-word;
}

.sort-label {
  color: #4A6275;
  font-size: 14px;
  font-weight: 500;
  word-wrap: break-word;
}

.sort-dropdown {
  background: #F0F4F8;
  overflow: hidden;
  border-radius: 8px;
  outline: 1px #D0DCE8 solid;
  outline-offset: -1px;
}

.sort-value {
  color: #1A2A3A;
  font-size: 14px;
  font-weight: 500;
  word-wrap: break-word;
}

.results-divider {
  background: #EEF2F6;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-dropdown-wrapper {
    position: relative;
}

.sort-dropdown {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    height: 1.75rem;
    cursor: pointer;
    gap: 0.35rem;
    user-select: none;
}

.sort-dropdown:hover {
    background: #E4EBF2;
}

.sort-arrow {
    color: #4A6275;
    font-size: 12px;
    line-height: 1;
}

.sort-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    outline: 1px solid #D0DCE8;
    z-index: 50;
    min-width: 140px;
    overflow: hidden;
}

.sort-menu.is-open {
    display: block;
}

.sort-option {
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    font-weight: 500;
    color: #1A2A3A;
    cursor: pointer;
    white-space: nowrap;
}

.sort-option:hover {
    background: #F0F4F8;
}

.sort-option-active {
    color: #0C447C;
    background: #EAF1FA;
}

/* ---- Citation Card ---- */

.citation-card {
    background: white;
    overflow: hidden;
    border-radius: 8px;
}

.card-header {
    background: #042C53;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    align-items: center;
    min-height: 1.875rem;
    padding: 0 0.75rem;
}

.card-header-text {
    color: #B5D4F4;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

.card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

/* Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Video Thumbnail */

.video-thumbnail {
    background: linear-gradient(180deg, #1C547E 0%, #102D43 100%);
    overflow: hidden;
    border-radius: 8px;
    width: 9.8rem;   /* ~157px */
    height: 6.7rem;  /* ~107px */
    position: relative;
    flex-shrink: 0;
}

.video-avatar {
    background: #042C53;
    border-radius: 9999px;
}

.video-avatar-body {
    background: #E6F1FB;
}

.video-duration-bg {
    background: rgba(4, 44, 83, 0.65);
    border-radius: 4px;
}

.video-duration {
    color: #E6F1FB;
    font-size: 13px;
    font-weight: 500;
    word-wrap: break-word;
    position: absolute;
    bottom: 0.4rem;
    right: 0.4rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

/* Card Content */

.card-title {
    color: #1A2A3A;
    font-size: 15px;
    font-weight: 500;
    word-wrap: break-word;
}

.card-meta {
    color: #7D94A7;
    font-size: 14px;
    font-weight: 400;
    word-wrap: break-word;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 0; /* prevents overflow issues */
}

/* Badge colors */
.badge-red { background: #FCEBEB; }
.badge-blue { background: #E6F1FB; }
.badge-green { background: #EAF3DE; }
.badge-amber { background: #FAEEDA; }
.badge-gray { background: #F1EFE8; }

/* Status Badges */

.badge {
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999rem;
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.badge-text-red {
    color: #A32D2D;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

.badge-text-blue {
    color: #0C447C;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

.badge-text-green {
    color: #3B6D11;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

.badge-text-amber {
    color: #854F0B;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

.badge-text-gray {
    color: #5F5E5A;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

/* Card Buttons */
.btn-download,
.btn-play,
.btn-more {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-download {
    background: #F0F4F8;
    overflow: hidden;
    outline: 1px #D0DCE8 solid;
    outline-offset: -1px;
}

.btn-download-text {
    color: #4A6275;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

.btn-play {
    background: #042C53;
    overflow: hidden;
    padding: 0 1rem;
}

.btn-play-text {
    color: #B5D4F4;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

.btn-more {
    overflow: hidden;
    outline-offset: -1px;
    padding: 0 0.25rem;
    width: auto;
    min-width: 2.375rem;
}

.btn-more-icon {
    background: #f0f4f8;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.bk-btn-more-icon {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.btn-download:hover {
    background: #e7edf3;
}

.btn-play:hover {
    opacity: 0.9;
}

/* Input inside .field-input - inherits field style, strips browser defaults */
.field-input input,
.field-input select {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    width: 100%;
    height: 100%;
    color: #042C53;
    font-size: 13px;
    font-weight: 400;
    padding-left: 1rem;
    padding-right: 0.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.field-input input::placeholder,
.field-input select::placeholder {
    color: #9BAFC0;
    font-weight: 400;
}
.field-input input:focus,
.field-input select:focus {
    outline: none;
    box-shadow: none;
}
/* Small dropdown arrow for selects */
.field-input select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239BAFC0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}
/* Flatpickr clear (×) button inside date filter fields */
.date-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #9BAFC0;
    cursor: pointer;
    line-height: 1;
    display: none;
    user-select: none;
}
.field-input:has(input[id^="cn-date"]:not(:placeholder-shown)) .date-clear {
    display: inline;
}
.field-input:has(input[id^="bk-date"]:not(:placeholder-shown)) .date-clear {
    display: inline;
}
.date-clear:hover {
    color: #042C53;
}

/* Flatpickr calendar theming to match app design */
.flatpickr-calendar {
    font-family: inherit;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(4,44,83,0.15);
    border: 1px solid #D9E5EF;
}
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
span.flatpickr-weekday {
    background: #042C53;
    color: #fff;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: #fff;
    color: #fff;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: #9BAFC0;
}
.flatpickr-current-month {
    color: #fff;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #042C53;
    color: #fff;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #042C53;
    border-color: #042C53;
}
.flatpickr-day:hover {
    background: #D9E5EF;
}
.flatpickr-day.today {
    border-color: #042C53;
}
.flatpickr-time input:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
    background: #D9E5EF;
}
.flatpickr-time .numInputWrapper span.arrowUp:after {
    border-bottom-color: #042C53;
}
.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-top-color: #042C53;
}
/* Time section header injected via JS */
.time-label {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #7D94A7;
    letter-spacing: 0.06em;
    padding: 5px 0 2px;
    text-transform: uppercase;
    border-top: 1px solid #D9E5EF;
}

/* Remove the default top border on the time section (label provides it) */
.flatpickr-time {
    border-top: none;
}

/* Video element inside .video-thumbnail */
.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    cursor: pointer;
}

/* Play icon overlay centered on the thumbnail */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(4, 44, 83, 0.60);
    border-radius: 9999px;
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E6F1FB;
    font-size: 1.05rem;
    pointer-events: none;
}
.video-thumbnail:hover .video-play-overlay {
    background: rgba(4, 44, 83, 0.85);
}

.client-sel {
    width:100%; 
    margin-bottom:18px
}

.client-sel .select, #selectClient, .group-sel {
    width:100%;
}

.selected-group {
    margin-right: 0.5rem;
}