@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300..800;1,300..800&display=swap');

/* =====================================================================================================
   Sense Web - Vidicode theme
   Follows the Speechlytics client styling (the Vidicode / VoiceCrunch brand): Vidicode navy as the main
   colour, the Vidicode lime as the accent, a translucent fixed header with pill navigation, rounded
   cards and the soft, uppercase-header data grid.
   ===================================================================================================== */

:root {
    --main-color: #211D58;
    --main-rgb: 33, 29, 88;
    --main-color-hover: #2e2978;
    --accent-color: #A6C537;
    --accent-rgb: 166, 197, 55;
    --accent-color-dark: #8AA82A;
    --white-color: #FFFFFF;
    --text-color: #2B2A45;
    --muted-color: #6B7280;
    --body-background-color: #F4F5FA;
    --surface-color: #FFFFFF;
    --border-color: #E3E6EF;
    --border-light-color: #EEF1F6;
    --header-height: 72px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 6px rgba(var(--main-rgb), 0.06);
    --shadow: 0 10px 28px rgba(var(--main-rgb), 0.08);
    --focus-ring: 0 0 0 .2rem rgba(var(--main-rgb), .15);

    --bs-link-color: var(--main-color);
    --bs-body-font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ----------------------------------------------------------------------------------------------------
   Base
   ---------------------------------------------------------------------------------------------------- */

html {
    font-size: 14px;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: var(--bs-body-font-family);
    color: var(--text-color);
    background-color: var(--body-background-color);
    background-image:
        radial-gradient(1200px 500px at 100% -10%, rgba(var(--accent-rgb), 0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 0%, rgba(var(--main-rgb), 0.07), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* The Vidicode background of Speechlytics behind every page: the image covers the window over a white page, which
   shows through where the image fades out; the header and footer sit on it at 96% white, and the cards and grids
   keep their own white surfaces. The page title sits on the dark side of the image, where it reads in white. */
.app-body {
    background: url('/branding/vidicode/background.png') center / cover no-repeat fixed, #ffffff;
}

.app-body .jumbotron > h1.display-4:first-child,
.app-body .page-title {
    border-bottom-color: rgba(255, 255, 255, 0.28);
    color: var(--white-color);
    text-shadow: 0 2px 12px rgba(10, 8, 40, 0.35);
}

.app-body .jumbotron > h1.display-4:first-child > i:first-child,
.app-body .page-title > i:first-child {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    text-shadow: none;
}

.app-body .back-link {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 16px rgba(10, 8, 40, 0.12);
}

.app-body .back-link:hover {
    background: var(--white-color);
}

a {
    color: var(--main-color);
}

a:hover {
    color: var(--main-color-hover);
}

::selection {
    background: rgba(var(--accent-rgb), 0.35);
}

/* ----------------------------------------------------------------------------------------------------
   Layout: header, main, footer
   ---------------------------------------------------------------------------------------------------- */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.app-header .navbar {
    min-height: var(--header-height);
    padding: 0;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(var(--main-rgb), 0.10);
    box-shadow: 0 8px 20px rgba(var(--main-rgb), 0.05);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

.app-header .container-fluid {
    min-height: var(--header-height);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 1.5rem;
    padding: 0;
    color: var(--main-color) !important;
    font-weight: 700;
    text-decoration: none;
}

.header-logo {
    height: 40px;
    width: auto;
}

.brand-text {
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.navbar-toggler {
    border: 1px solid rgba(var(--main-rgb), 0.15);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    color: var(--main-color);
    font-size: 1.4rem;
    line-height: 1;
}

.navbar-toggler:focus {
    box-shadow: var(--focus-ring);
}

.navbar-collapse {
    align-items: center;
    gap: 1rem;
}

.navbar-nav {
    gap: 0.35rem;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.85rem !important;
    border-radius: var(--radius-sm);
    color: var(--main-color) !important;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.navbar-nav .nav-link i {
    font-size: 1rem;
    opacity: 0.9;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus-visible,
.navbar-nav .show > .nav-link {
    background: rgba(var(--main-rgb), 0.06);
}

.navbar-nav .nav-link.active {
    background: rgba(var(--main-rgb), 0.10);
    box-shadow: inset 0 -2px 0 var(--accent-color);
}

.dropdown-menu {
    min-width: 13rem;
    padding: 0.4rem;
    border: 1px solid rgba(var(--main-rgb), 0.12);
    border-radius: var(--radius);
    box-shadow: 0 12px 24px rgba(var(--main-rgb), 0.12);
}

.dropdown-item,
.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--main-color);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.dropdown-item i {
    width: 1.1rem;
    text-align: center;
    opacity: 0.85;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-menu li a:hover {
    background: rgba(var(--main-rgb), 0.06);
    color: var(--main-color);
}

.dropdown-item.active,
.dropdown-item:active {
    background: rgba(var(--main-rgb), 0.10);
    color: var(--main-color);
    font-weight: 600;
}

.dropdown-divider {
    margin: 0.3rem 0;
    border-color: var(--border-light-color);
}

.scrollable-dropdown {
    max-height: 400px;
    overflow-y: auto;
    min-width: 220px;
}

/* Account pill on the right of the header. */
.navbar-nav-login {
    margin-left: auto;
}

.navbar-nav-login .nav-link {
    border-radius: 999px;
    background: rgba(var(--main-rgb), 0.06);
}

.navbar-nav-login .nav-link:hover,
.navbar-nav-login .show > .nav-link {
    background: rgba(var(--main-rgb), 0.11);
}

.account-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-container {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1680px;
    padding: calc(var(--header-height) + 1.75rem) 1.5rem 2.5rem;
}

.app-footer {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(var(--main-rgb), 0.10);
    box-shadow: 0 -8px 20px rgba(var(--main-rgb), 0.04);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 0.75rem;
    min-height: 56px;
    padding: 0.6rem 1.1rem;
    color: var(--main-color);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    text-align: center;
}

.footer-powered {
    color: var(--muted-color);
    font-weight: 500;
}

.footer-logo {
    height: 26px;
    width: auto;
}

/* ----------------------------------------------------------------------------------------------------
   Page headings - every page opens with  .jumbotron > h1.display-4  followed by an hr.
   ---------------------------------------------------------------------------------------------------- */

.jumbotron {
    padding: 0;
    background: transparent;
}

.jumbotron > h1.display-4:first-child,
.page-title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0 0 1.75rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid rgba(var(--main-rgb), 0.12);
    color: var(--main-color);
    font-size: clamp(1.4rem, 1.15rem + 0.8vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.jumbotron > h1.display-4:first-child::after,
.page-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent-color);
}

.jumbotron > h1.display-4:first-child > i:first-child,
.page-title > i:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 10px;
    background: var(--main-color);
    color: var(--white-color);
    font-size: 1.2rem;
    box-shadow: 0 8px 18px rgba(var(--main-rgb), 0.2);
}

/* A title that is a breadcrumb, as on the Speechlytics call details page: Calls -> {id}, the parent a link back. */
.page-title-breadcrumb {
    flex-wrap: wrap;
    row-gap: 0.35rem;
}

.page-title-link {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.page-title-link:hover,
.page-title-link:focus-visible {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    opacity: 1;
}

.page-title-separator {
    font-size: 0.7em;
    opacity: 0.7;
}

.page-title-current {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The rule under the title is drawn by the title itself now. */
.jumbotron > h1.display-4:first-child + hr {
    display: none;
}

.jumbotron > hr,
#htmltoimage > hr {
    margin: 1.5rem 0;
    border-color: rgba(var(--main-rgb), 0.15);
}

.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
    color: var(--main-color);
}

h4.display-6 {
    font-size: 1.15rem;
    font-weight: 700 !important;
    margin-bottom: 1rem;
}

/* Back link above a details page. */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    width: auto;
    padding: 0.35rem 0.8rem 0.35rem 0.5rem;
    border-radius: 999px;
    background: rgba(var(--main-rgb), 0.06);
    color: var(--main-color);
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    background: rgba(var(--main-rgb), 0.11);
}

/* ----------------------------------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible {
    box-shadow: var(--focus-ring);
}

.btn-secondary,
.btn-primary {
    background: var(--main-color);
    border: 1px solid var(--main-color);
    color: var(--white-color);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-primary:hover,
.btn-primary:focus,
.btn-check:checked + .btn-secondary,
.btn-secondary.show {
    background: var(--main-color-hover);
    border-color: var(--main-color-hover);
    color: var(--white-color);
}

.btn-outline-secondary,
.btn-outline-primary {
    background: var(--surface-color);
    border: 1px solid rgba(var(--main-rgb), 0.25);
    color: var(--main-color) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--main-color);
    border-color: var(--main-color);
    color: var(--white-color) !important;
}

/* Disabled buttons keep their own colours, faded; without this Bootstrap's default blue shows through. */
.btn-secondary:disabled,
.btn-secondary.disabled,
.btn-primary:disabled,
.btn-primary.disabled {
    background: var(--main-color);
    border-color: var(--main-color);
    color: var(--white-color);
    opacity: 0.4;
}

.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled,
.btn-outline-primary:disabled,
.btn-outline-primary.disabled {
    background: var(--surface-color);
    border-color: rgba(var(--main-rgb), 0.25);
    opacity: 0.45;
}

/* Destructive action next to the outline buttons (Delete). */
.btn-outline-danger {
    background: var(--surface-color);
    border: 1px solid rgba(220, 53, 69, 0.35);
    color: #B42332;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: #DC3545;
    border-color: #DC3545;
    color: var(--white-color);
}

.btn-outline-danger:disabled,
.btn-outline-danger.disabled {
    background: var(--surface-color);
    border-color: rgba(220, 53, 69, 0.35);
    color: #B42332;
    opacity: 0.45;
}

.btn-accent {
    background: var(--accent-color);
    border: 1px solid var(--accent-color);
    color: var(--main-color);
}

.btn-accent:hover {
    background: var(--accent-color-dark);
    border-color: var(--accent-color-dark);
    color: var(--main-color);
}

.btn-logout {
    color: var(--main-color);
    font-weight: 600;
}

.dropdown button {
    min-width: 140px;
}

.dashboard-button {
    margin-left: 0;
}

.dashboard-button-text {
    margin-left: 6px;
}

/* Toolbars made of buttons and dropdowns. */
.flex-start {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.flex-start > .dropdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 !important;
}

/* Page actions: the icon-only Refresh and the Export button, right-aligned as in the Dashboard and Statistics filter bar. */
.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.page-actions form {
    margin: 0;
}

.page-actions .btn {
    min-width: 0;
    min-height: 40px;
}

/* A square button holding only an icon (Refresh); its tooltip and aria-label name it. */
.btn.btn-icon {
    width: 40px;
    min-width: 0;
    min-height: 40px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
}

.btn.btn-icon:hover,
.btn.btn-icon:focus-visible {
    border-color: var(--main-color);
    background: rgba(var(--main-rgb), 0.07);
    color: var(--text-color);
}

/* ----------------------------------------------------------------------------------------------------
   Forms
   ---------------------------------------------------------------------------------------------------- */

.form-label,
.control-label {
    margin-bottom: 0.35rem;
    color: var(--main-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 44px;
    border: 1px solid #D8DEEA;
    border-radius: 10px;
    color: var(--main-color);
    box-shadow: none;
}

.form-control::placeholder {
    color: #9AA0B4;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23211D58' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
    background-size: 1rem 1rem;
    cursor: pointer;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--main-color);
    box-shadow: var(--focus-ring);
    color: var(--main-color);
}

.form-check-input:checked {
    background-color: var(--main-color);
    border-color: var(--main-color);
}

/* Date filters: a text input with a drawn-in calendar icon that opens the Flatpickr calendar (initDateTimePicker
   in site.js), the same picker and look as Speechlytics. */
.date-input,
.date-input.flatpickr-input[readonly],
.mvc-grid-popup .mvc-grid-value.date-input {
    padding-right: 2.6rem;
    background-color: var(--surface-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23211D58' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.25' y='3.25' width='11.5' height='10.5' rx='2'/%3E%3Cpath d='M5 1.75v3M11 1.75v3M2.5 6.25h11'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem 1rem;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.date-input::placeholder {
    color: var(--muted-color);
}

.flatpickr-calendar {
    border: 1px solid rgba(var(--main-rgb), 0.14);
    border-radius: 12px;
    background: #fff;
    color: var(--main-color);
    box-shadow: 0 18px 34px rgba(var(--main-rgb), 0.14);
    font-family: var(--bs-body-font-family);
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
    border-bottom-color: rgba(var(--main-rgb), 0.14);
}

.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after {
    border-top-color: rgba(var(--main-rgb), 0.14);
}

.flatpickr-months,
.flatpickr-weekdays,
.flatpickr-weekdaycontainer,
.flatpickr-rContainer,
.flatpickr-days,
.dayContainer {
    background: #fff;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--main-color);
    font-weight: 600;
}

.flatpickr-weekday {
    color: var(--muted-color) !important;
    font-weight: 600;
}

.flatpickr-day {
    border-radius: 8px;
    color: var(--main-color);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.notAllowed,
.flatpickr-day.notAllowed.prevMonthDay,
.flatpickr-day.notAllowed.nextMonthDay {
    color: rgba(var(--main-rgb), 0.3);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    border-color: var(--main-color);
    background: var(--main-color);
    color: #fff !important;
}

.flatpickr-day.today {
    border-color: var(--accent-color);
}

.flatpickr-day.today:hover {
    border-color: var(--accent-color);
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--main-color);
}

.flatpickr-day:hover {
    border-color: rgba(var(--main-rgb), 0.08);
    background: rgba(var(--main-rgb), 0.08);
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: var(--main-color);
    fill: var(--main-color);
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
    fill: var(--main-color);
}

.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator {
    color: var(--main-color);
    font-weight: 600;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus {
    background: rgba(var(--main-rgb), 0.06);
}

.validation-summary-valid {
    display: none;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.1rem;
}

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(var(--main-rgb), 0.55);
    pointer-events: none;
}

.input-icon > .form-control {
    padding-left: 2.6rem;
}

.form-control input,
.form-signin .form-control {
    color: var(--main-color);
}

.editor-field {
    font-size: 14px;
    text-align: left;
    margin-top: 24px;
}

/* ----------------------------------------------------------------------------------------------------
   Filter card (calls list)
   ---------------------------------------------------------------------------------------------------- */

.filter-card {
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.more-filters-panel {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #E3EAF7;
    border-radius: var(--radius);
    background: #F8F9FD;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 1rem;
}

.filter-actions-end {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.filter-actions-end .btn {
    min-width: 120px;
}

.more-filters-btn[aria-expanded="true"] {
    background: rgba(var(--main-rgb), 0.08);
}

/* ----------------------------------------------------------------------------------------------------
   Cards
   ---------------------------------------------------------------------------------------------------- */

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 0.75rem 1rem;
    border-bottom: 0;
    background-color: var(--main-color);
    color: var(--white-color);
    font-weight: 600;
}

.card-header .card-title,
.card-header h5,
.card-header h6 {
    margin: 0;
    color: inherit;
}

.card p {
    color: var(--main-color);
}

.bordered-card {
    border: 1px solid var(--border-color);
}

.grid-card {
    padding: 0;
}

/* Dashboard numbers. */
.dashboard-statistics .card {
    height: 100%;
}

.dashboard-statistics .card .card-title {
    font-size: 1rem;
}

.dashboard-statistics .card-body.display-5 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.4rem);
    font-weight: 800;
}

.dashboard-statistics canvas {
    height: 100% !important;
}

.dashboard-graphs,
.dashboard-graphs canvas {
    max-height: 350px;
}

.dashboard-max-height {
    max-height: 280px;
    overflow-y: auto;
}

/* ----------------------------------------------------------------------------------------------------
   Data grid (NonFactors Mvc.Grid)
   ---------------------------------------------------------------------------------------------------- */

.mvc-grid {
    overflow: visible;
}

.mvc-grid-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.mvc-grid-table > table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    background: transparent;
}

.mvc-grid-table > table > thead > tr > th,
.mvc-grid-table > table > tbody > tr > td,
.mvc-grid-table > table > tfoot > tr > td {
    border: 0;
    border-bottom: 1px solid var(--border-light-color);
}

.mvc-grid-table > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.85rem 0.75rem;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-color);
    color: var(--muted-color);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.mvc-grid-table > table > thead > tr > th.sortable {
    padding-right: 2.25em;
}

.mvc-grid-title {
    color: var(--muted-color) !important;
    font-weight: 700;
}

.mvc-grid-table > table > tbody > tr > td {
    padding: 0.8rem 0.75rem;
    color: var(--text-color);
    vertical-align: middle;
    white-space: nowrap;
    word-break: normal;
    transition: background-color 0.15s ease;
}

/* Short values (numbers, dates, durations) never break; free text opts in to wrapping. */
.mvc-grid-table > table > tbody > tr > td.grid-wrap {
    min-width: 240px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.mvc-grid-table > table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.mvc-grid-table > table > tbody > tr:hover > td {
    background: rgba(var(--main-rgb), 0.035);
}

.mvc-grid-table > table > tbody > tr > td.bold {
    color: var(--main-color);
    white-space: nowrap;
}

.mvc-grid-empty-row td {
    padding: 2.5rem 1rem !important;
    color: var(--muted-color) !important;
    text-align: center;
}

.mvc-grid-sort,
.mvc-grid-filter {
    border-radius: 6px;
}

.mvc-grid-table .asc .mvc-grid-sort::before,
.mvc-grid-table .desc .mvc-grid-sort::after {
    color: var(--main-color);
}

.mvc-grid-header-mode .mvc-grid-value,
.mvc-grid-row-filters .mvc-grid-value {
    border-radius: 6px;
}

.mvc-grid-popup {
    border: 1px solid rgba(var(--main-rgb), 0.15);
    border-radius: var(--radius);
    box-shadow: 0 12px 24px rgba(var(--main-rgb), 0.12);
}

.mvc-grid-popup .mvc-grid-apply {
    border-color: var(--main-color);
    background: var(--main-color);
}

.mvc-grid-popup .mvc-grid-value,
.mvc-grid-popup .mvc-grid-operator {
    border-radius: 6px;
}

/* Cells rendered by the calls grid. */
.grid-icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(var(--main-rgb), 0.07);
    color: var(--main-color);
    font-size: 1.05rem;
}

.grid-icon-btn:hover {
    background: var(--main-color);
    color: var(--white-color);
}

.grid-icon-btn.no-events {
    background: transparent;
    color: #B3B6C6;
}

.grid-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(var(--main-rgb), 0.06);
    color: var(--main-color);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.grid-link:hover {
    background: var(--main-color);
    color: var(--white-color);
}

.mvc-grid-table td .progress {
    min-width: 90px;
    height: 0.9rem;
    border-radius: 999px;
    background: #ECEEF5;
}

.progress-bar {
    background-color: var(--main-color);
}

/* Pager */
.mvc-grid-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    padding-top: 1rem;
    text-align: right !important;
}

.mvc-grid-pager button {
    box-sizing: border-box;
    min-width: 2.4rem;
    height: 2.4rem;
    margin: 0;
    padding: 0 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--main-color);
    font-weight: 600;
    line-height: 1;
}

.mvc-grid-pager button:hover {
    border-color: var(--main-color);
    background: rgba(var(--main-rgb), 0.05);
}

.mvc-grid-pager .active,
.mvc-grid-pager .active:hover {
    border-color: var(--main-color) !important;
    background: var(--main-color) !important;
    color: var(--white-color);
}

.mvc-grid-pager [disabled],
.mvc-grid-pager [disabled]:hover {
    border-color: var(--border-light-color);
    background: #F7F8FB;
    color: #B3B6C6;
}

.mvc-grid-page-sizes {
    margin-left: 0.4rem;
}

.mvc-grid-page-sizes select,
.mvc-grid-page-sizes input {
    height: 2.4rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--main-color);
}

.records-grid-footer {
    display: flex;
    align-items: flex-end;
}

/* Plain tables outside the grid (about page, side bar). */
table {
    background: transparent;
}

/* ----------------------------------------------------------------------------------------------------
   Modals, tooltips, badges, accordion
   ---------------------------------------------------------------------------------------------------- */

.modal-content {
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 48px rgba(var(--main-rgb), 0.25);
}

.modal-header {
    border-bottom: 1px solid var(--border-light-color);
}

.modal-title {
    color: var(--main-color) !important;
    font-weight: 700;
}

.modal-close-icon {
    color: var(--main-color);
}

.tooltip {
    --bs-tooltip-bg: var(--main-color);
}

.tooltip > .tooltip-inner {
    background-color: var(--main-color);
    color: var(--white-color);
    padding: 0.35rem 0.7rem;
    font-weight: 600;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
    border-top-color: var(--main-color);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
    border-bottom-color: var(--main-color);
}

.tooltip.bs-tooltip-start .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before {
    border-left-color: var(--main-color);
}

.tooltip.bs-tooltip-end .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before {
    border-right-color: var(--main-color);
}

.badge.badge-primary {
    background: var(--main-color) !important;
}

.badge-secondary {
    border: 1px solid var(--main-color);
    color: var(--main-color);
}

.nav-tabs {
    border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link {
    padding-left: 16px !important;
    padding-right: 16px !important;
    color: var(--main-color) !important;
    font-weight: 600;
}

.nav-tabs .nav-link.active {
    box-shadow: inset 0 -3px 0 var(--accent-color);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--main-color);
}

.accordion-item {
    border-color: var(--border-color);
}

.accordion-item:first-of-type,
.accordion-item:first-of-type .accordion-button {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.accordion-button {
    background-color: var(--main-color) !important;
    color: var(--white-color) !important;
    font-weight: 600;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.accordion-button:focus {
    box-shadow: var(--focus-ring);
}

.accordion-button::after {
    transition: transform 0.3s ease;
}

.accordion-button.collapsed::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-button:not(.collapsed) {
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-180deg);
}

.accordion-collapse {
    transition: height 0.28s cubic-bezier(.4, 0, .2, 1), opacity 0.2s ease;
}

.accordion-collapse .accordion-body {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.accordion-collapse.show .accordion-body {
    opacity: 1;
    transform: translateY(0);
}

/* ----------------------------------------------------------------------------------------------------
   Sign-in pages
   ---------------------------------------------------------------------------------------------------- */

.auth-body {
    background:
        linear-gradient(100deg, rgba(var(--main-rgb), 0.82) 0%, rgba(var(--main-rgb), 0.45) 45%, rgba(var(--main-rgb), 0.15) 100%),
        url('/branding/vidicode/background.png') center / cover no-repeat fixed,
        var(--main-color);
}

.auth-container {
    flex: 1 0 auto;
    display: flex;
    width: 100%;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 3rem clamp(1rem, 4vw, 4rem);
}

.auth-hero {
    align-items: center;
}

.hero-content {
    max-width: 560px;
}

.hero-title {
    margin: 0 0 1rem;
    color: var(--white-color);
    font-size: clamp(2.4rem, 1.4rem + 3vw, 4.2rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    text-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.hero-tagline {
    display: inline-block;
    margin: 0;
    padding-top: 0.75rem;
    border-top: 3px solid var(--accent-color);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.auth-panel {
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2.25rem 2rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 30px 60px rgba(10, 8, 40, 0.35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.auth-card-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-logo {
    width: 100%;
    max-width: 260px;
    height: auto;
    margin-bottom: 1.5rem;
}

.auth-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 0.35rem;
    color: var(--main-color);
    font-size: 1.6rem;
    font-weight: 700;
}

.auth-subtitle {
    margin: 0;
    color: var(--muted-color);
}

.auth-validation:empty {
    display: none;
}

.auth-validation .validation-summary-errors {
    margin-bottom: 1rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(220, 53, 69, 0.25);
    border-radius: 10px;
    background: rgba(220, 53, 69, 0.06);
    font-size: 0.9rem;
}

.auth-form .form-control {
    min-height: 48px;
}

.auth-submit {
    min-height: 48px;
    font-size: 1.05rem;
}

.otp-input {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.4em;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    color: var(--main-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-body .app-footer {
    background: rgba(255, 255, 255, 0.9);
}

/* ----------------------------------------------------------------------------------------------------
   Loader
   ---------------------------------------------------------------------------------------------------- */

.global-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    cursor: progress;
}

.global-loader.is-visible {
    display: flex;
}

.global-loader-dial {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-loader .loader {
    width: 96px;
    height: 96px;
    border: 5px solid rgba(var(--main-rgb), 0.12);
    border-top-color: var(--main-color);
    border-right-color: var(--accent-color);
    border-radius: 50%;
    animation: global-loader-spin 0.9s linear infinite;
}

.global-loader-label {
    position: absolute;
    color: var(--main-color);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

@keyframes global-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .global-loader .loader {
        animation-duration: 4s;
    }
}

/* ----------------------------------------------------------------------------------------------------
   Utilities kept from the original stylesheet
   ---------------------------------------------------------------------------------------------------- */

.full-width,
.full-width-mobile {
    width: 100%;
}

.flex-centered {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-equal > * {
    flex: 1;
}

@media (min-width: 768px) {
    .flex-md-equal > * {
        flex: 1;
    }
}

.text-align-right,
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.m-l-auto,
.margin-left-auto {
    margin-left: auto;
}

.m-r-auto {
    margin-right: auto;
}

.bold {
    font-weight: 600;
}

.no-decoration {
    text-decoration: none;
}

.text-underline {
    text-decoration: underline;
}

.no-padding {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.cursor-pointer {
    cursor: pointer;
}

.no-events {
    pointer-events: none !important;
}

.myTabContent {
    padding: 0 !important;
    margin-top: 20px;
}

.login-container {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.confirmAccount-container {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.email-template {
    color: var(--main-color) !important;
}

.email-template img {
    max-width: 300px;
}

.email-regards p,
.company-details p {
    padding-bottom: 4px;
    margin-bottom: 0;
}

.not-found-img {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: var(--radius);
}

.finished-call {
    color: #2E9E5B;
}

.ongoing-call {
    color: #D63A3A;
}

.base-icon i {
    color: var(--main-color);
}

.noty_theme__mint.noty_type__success {
    background-color: var(--accent-color) !important;
}

.noty_layout {
    top: calc(var(--header-height) + 8px) !important;
}

/* ----------------------------------------------------------------------------------------------------
   Call details: the player and the transcription timeline of the Speechlytics call details page
   ---------------------------------------------------------------------------------------------------- */

.details-page-shell {
    --details-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(var(--main-rgb), 0.14);
    border-radius: var(--details-radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 245, 251, 0.98) 100%);
    box-shadow: 0 18px 36px rgba(var(--main-rgb), 0.08);
}

/* The player: file name and actions in the header, the waveform with its lanes and time, the transport. */
.player-shell {
    overflow: hidden;
    border: 1px solid rgba(var(--main-rgb), 0.1);
    border-radius: calc(var(--details-radius, 12px) - 2px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 246, 251, 0.98) 100%);
}

.player-shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid rgba(var(--main-rgb), 0.12);
    background: rgba(255, 255, 255, 0.96);
}

.player-shell-eyebrow {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
    color: var(--muted-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* The file name is data, not a label: no caps, and it is the part of the header that truncates. */
.player-shell-filename {
    min-width: 0;
    overflow: hidden;
    color: var(--main-color);
    font-weight: 600;
    letter-spacing: 0;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.player-shell-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.4rem;
}

.player-shell-actions form {
    margin: 0;
}

.player-shell-actions .dropdown button {
    min-width: 0;
}

.player-shell-body {
    padding: 1rem 1.1rem 1.1rem;
}

.player {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.player-waveform-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.player-waveform-labels {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: space-around;
    gap: 0.25rem;
    width: 5.5rem;
}

.player-waveform-label {
    overflow: hidden;
    color: var(--main-color);
    font-size: 12px;
    font-weight: 600;
    line-height: 32px;
    white-space: nowrap;
    text-align: right;
    text-overflow: ellipsis;
}

.player-waveform {
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}

.player-waveform-time {
    flex: 0 0 auto;
    color: var(--main-color);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.player-waveform-time-sep {
    margin: 0 0.3rem;
    opacity: 0.45;
}

.player-control-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn.player-btn {
    width: 40px;
    min-width: 0;
    min-height: 40px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--main-color);
    font-size: 1.05rem;
}

.btn.player-btn:hover,
.btn.player-btn:focus-visible {
    border-color: rgba(var(--main-rgb), 0.2);
    background: rgba(var(--main-rgb), 0.07);
    color: var(--main-color);
}

.btn.player-btn-main {
    width: 48px;
    min-height: 48px;
    background: var(--main-color);
    color: var(--white-color);
    font-size: 1.35rem;
    box-shadow: 0 8px 18px rgba(var(--main-rgb), 0.22);
}

.btn.player-btn-main:hover,
.btn.player-btn-main:focus-visible {
    background: var(--main-color-hover);
    color: var(--white-color);
}

/* Stands in for the player, at the height the waveform and controls would have. */
.player-unavailable {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 96px;
    padding: 0 1rem;
    color: var(--main-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.player-unavailable .bi {
    flex: 0 0 auto;
    opacity: 0.55;
    font-size: 1.1rem;
}

/* An archived call whose file was deleted: restore it from its archive folder, then play. */
.player-restore {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 640px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
}

.player-restore-title {
    margin: 0 0 0.25rem;
    color: var(--main-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.player-restore .form-label {
    margin: 0;
    font-size: 0.85rem;
}

.player-restore-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.player-restore-row .form-control {
    flex: 1 1 240px;
    min-width: 0;
}

.player-restore-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.5rem;
    font-size: 0.85rem;
}

/* Compact: one short bar with the play button beside it. */
.player-shell.is-compact .player-shell-body {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.player-shell.is-compact .player {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.player-shell.is-compact .player-waveform-row {
    flex: 1 1 auto;
    min-width: 0;
}

.player-shell.is-compact .player-waveform-labels,
.player-shell.is-compact [data-player-action="backward"],
.player-shell.is-compact [data-player-action="forward"],
.player-shell.is-compact .player-btn-stop {
    display: none !important;
}

.player-modal .modal-body {
    padding: 1.25rem;
}

.player-modal .player-shell {
    border: 0;
    background: transparent;
}

/* The call information on the left, the transcription on the right; one column on narrow screens. */
.player-details {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
}

.player-details.is-without-sidebar {
    grid-template-columns: minmax(0, 1fr);
}

.player-details-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    min-width: 0;
}

.player-details-sidebar .accordion {
    overflow: hidden;
    border: 1px solid rgba(var(--main-rgb), 0.12);
    border-radius: calc(var(--details-radius, 12px) - 2px);
    background: rgba(255, 255, 255, 0.98);
}

.player-details-sidebar .accordion-item {
    border-right: 0;
    border-left: 0;
    border-radius: 0 !important;
}

.player-details-sidebar .accordion-item:first-of-type {
    border-top: 0;
}

.player-details-sidebar .accordion-item:last-of-type {
    border-bottom: 0;
}

/* Lighter than the navy accordion of the other pages: white headers, the open one marked in the accent. */
.player-details-sidebar .accordion-button {
    background-color: var(--surface-color) !important;
    color: var(--main-color) !important;
    font-size: 0.92rem;
}

.player-details-sidebar .accordion-button:not(.collapsed) {
    box-shadow: inset 3px 0 0 var(--accent-color), inset 0 -1px 0 var(--border-light-color);
}

.player-details-sidebar .accordion-button::after,
.player-details-sidebar .accordion-button.collapsed::after,
.player-details-sidebar .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23211D58'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.player-details-sidebar .accordion-body {
    padding: 0.75rem 1rem 1rem;
}

.player-details-sidebar .table {
    margin: 0;
    font-size: 0.88rem;
}

/* The tables carry a "#" header row with nothing in it. */
.player-details-sidebar .table > thead {
    display: none;
}

.player-details-sidebar .table > :not(caption) > * > * {
    padding: 0.45rem 0.25rem;
    border-width: 0 0 1px;
    border-color: var(--border-light-color);
    background: transparent;
}

.player-details-sidebar .table th {
    width: 42%;
    color: var(--muted-color);
    font-weight: 600;
}

.player-details-sidebar .table td {
    color: var(--text-color);
    overflow-wrap: anywhere;
}

.call-details-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    text-wrap: wrap !important;
}

.keyword-tag {
    cursor: pointer;
    text-decoration: none;
}

.keyword-tag-active {
    background: var(--accent-color) !important;
    color: var(--main-color) !important;
}

.player-details-main {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(var(--main-rgb), 0.1);
    border-radius: calc(var(--details-radius, 12px) - 2px);
    background: rgba(255, 255, 255, 0.9);
}

.player-details-main-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.95rem 1rem 0;
    border-bottom: 1px solid rgba(var(--main-rgb), 0.12);
    background: rgba(255, 255, 255, 0.95);
}

.player-details-main-heading {
    min-width: 0;
    padding-bottom: 0.75rem;
}

.player-details-eyebrow {
    color: var(--muted-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.player-details-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.35rem;
    margin: 0.2rem 0 0;
    color: var(--main-color);
    font-size: 1.15rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.player-details-tabs {
    border-bottom: 0;
}

.player-details-main-body {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.98);
}

/* The transcription: speaker lanes either side of a timeline of timestamps. */
.player-transcription-flow {
    --channel-active-tint: rgba(84, 73, 139, 0.1);
    --channel-active-border: #54498b;
    --channel-active-shadow: rgba(84, 73, 139, 0.18);
    --channel-active-bubble: #f4f1fb;
    --channel-active-ring: rgba(84, 73, 139, 0.16);
    padding: 0.25rem 0.4rem 0;
    border-radius: 18px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.player-transcription-flow[data-active-channel="right"] {
    --channel-active-tint: rgba(139, 56, 50, 0.1);
    --channel-active-border: #8b3832;
    --channel-active-shadow: rgba(139, 56, 50, 0.18);
    --channel-active-bubble: #fbf0ef;
    --channel-active-ring: rgba(139, 56, 50, 0.16);
}

.player-transcription-flow[data-active-channel="both"] {
    --channel-active-tint: rgba(90, 66, 110, 0.1);
    --channel-active-border: #6b4f86;
    --channel-active-shadow: rgba(107, 79, 134, 0.18);
    --channel-active-bubble: #f5f1f8;
    --channel-active-ring: rgba(107, 79, 134, 0.16);
}

.player-transcription-flow.has-active-channel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, var(--channel-active-tint) 100%);
    box-shadow: inset 0 0 0 1px rgba(214, 220, 229, 0.7);
}

.player-transcription-flow-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 0.5rem 0.75rem;
    border-bottom: 1px solid #d6dce5;
}

.player-transcription-flow-label {
    color: #6a7381;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.player-transcription-flow-label-center {
    text-align: center;
}

.player-transcription-flow-label-right {
    text-align: right;
}

.player-transcription-flow-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding-bottom: 1rem;
}

.player-transcription-flow-body::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 0.5px);
    width: 1px;
    background: linear-gradient(180deg, #d6dce5 0%, #e8edf3 100%);
}

.player-transcription-flow-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    padding: 0.3rem 0.5rem;
    border-radius: 16px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.player-transcription-flow-row.is-active-chunk {
    background: var(--channel-active-tint);
    box-shadow: 0 10px 24px -18px var(--channel-active-shadow);
}

.player-transcription-lane {
    display: flex;
    min-width: 0;
}

.player-transcription-lane-left {
    justify-content: flex-end;
}

.player-transcription-lane-right {
    justify-content: flex-start;
}

.player-transcription-timeline-marker {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding-top: 0.55rem;
}

.player-transcription-timeline-dot {
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #183a5a;
    box-shadow: 0 0 0 3px #eef2f6;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.player-transcription-timeline-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 0.2rem 0.5rem;
    border: 1px solid #d6dce5;
    border-radius: 999px;
    background: #fff;
    color: #5d6674;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.player-transcription-timeline-time:hover,
.player-transcription-timeline-time:focus-visible {
    border-color: var(--main-color);
    color: var(--main-color);
}

.player-transcription-bubble {
    width: min(100%, 520px);
    padding: 0.9rem 1rem;
    border: 1px solid #d8dde6;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(18, 35, 52, 0.04);
    font-size: 14px;
    line-height: 1.65;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.player-transcription-bubble-left {
    border-right: 4px solid #213e5a;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    color: #213e5a;
}

.player-transcription-bubble-right {
    border-left: 4px solid #5b6b7f;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
    color: #4e5f73;
}

.player-transcription-bubble-both {
    border-right: 4px solid #3a4a5f;
    border-left: 4px solid #3a4a5f;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7fa 100%);
    color: #31465c;
}

.player-transcription-bubble:hover {
    border-color: #c4cbd7;
}

.player-transcription-bubble .chunk-item-word {
    display: inline;
    color: inherit;
}

/* What has been said so far reads bold. */
.player-transcription-bubble.is-played .chunk-item-word {
    font-weight: 700;
}

.player-transcription-flow-row.is-active-chunk .player-transcription-bubble {
    background: linear-gradient(180deg, #ffffff 0%, var(--channel-active-bubble) 100%);
    box-shadow: 0 14px 36px -24px var(--channel-active-shadow);
    transform: translateY(-1px);
}

.player-transcription-flow-row.is-active-chunk .player-transcription-timeline-dot {
    background: var(--channel-active-border);
    box-shadow: 0 0 0 4px var(--channel-active-ring);
    transform: scale(1.05);
}

.player-transcription-flow-row.is-active-chunk .player-transcription-timeline-time {
    border-color: var(--channel-active-ring);
    background: var(--channel-active-bubble);
    color: var(--channel-active-border);
}

/* A word picked in Keywords or Frequent Words. */
.chunk-item-word.chunk-item-word-active {
    border-radius: 3px;
    background: rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.35);
}

.player-transcription-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 120px;
    color: var(--muted-color);
    font-weight: 600;
}

.analytics-block {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #e2e7ef;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.analytics-block:last-child {
    margin-bottom: 0;
}

.analytics-block-title {
    margin: 0 0 0.6rem;
    color: var(--main-color);
    font-size: 0.95rem;
    font-weight: 700;
}

.analytics-list {
    margin: 0;
    padding-left: 1.1rem;
}

.analytics-list li + li {
    margin-top: 0.35rem;
}

@media (max-width: 991.98px) {
    .player-details {
        grid-template-columns: minmax(0, 1fr);
    }

    .player-details-sidebar {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .details-page-shell {
        padding: 0.6rem;
    }

    .player-waveform-labels {
        display: none;
    }

    .player-transcription-flow-header {
        display: none;
    }

    .player-transcription-flow-body::before {
        left: 29px;
    }

    .player-transcription-flow-row {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 0.6rem;
        padding: 0.3rem 0.25rem;
    }

    .player-transcription-lane-left,
    .player-transcription-lane-right {
        grid-column: 2;
        justify-content: flex-start;
    }

    .player-transcription-lane-left:not(:has(.chunk-item)),
    .player-transcription-lane-right:not(:has(.chunk-item)) {
        display: none;
    }

    .player-transcription-timeline-marker {
        grid-column: 1;
        grid-row: 1;
        padding-top: 0.8rem;
    }

    /* The timeline is on the left here, so every bubble carries its speaker's colour on that side. */
    .player-transcription-bubble {
        width: 100%;
    }

    .player-transcription-bubble-left {
        border-right: 1px solid #d8dde6;
        border-left: 4px solid #213e5a;
    }

    .player-transcription-bubble-right {
        border-left: 4px solid #5b6b7f;
    }

    .player-transcription-bubble-both {
        border-right: 1px solid #d8dde6;
        border-left: 4px solid #3a4a5f;
    }
}

@media (prefers-reduced-motion: reduce) {
    .player-transcription-flow,
    .player-transcription-flow-row,
    .player-transcription-bubble,
    .player-transcription-timeline-dot {
        transition: none;
    }

    .player-transcription-flow-row.is-active-chunk .player-transcription-bubble {
        transform: none;
    }
}

/* ----------------------------------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------------------------------------- */

@media (min-width: 992px) {
    .modal-dialog:not(.modal-sm):not(.modal-lg):not(.modal-xl) {
        max-width: 75%;
    }
}

/* Collapsed navigation (tablets and phones). */
@media (max-width: 991.98px) {
    .app-header .container-fluid {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .navbar-collapse {
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        margin-top: 0.6rem;
        padding: 0.6rem 0 0.4rem;
        border-top: 1px solid rgba(var(--main-rgb), 0.1);
    }

    .navbar-nav {
        align-items: stretch;
        gap: 0.15rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 0.85rem !important;
    }

    .navbar-nav .nav-link.active {
        box-shadow: inset 3px 0 0 var(--accent-color);
    }

    .navbar-nav .dropdown-menu {
        margin: 0.15rem 0 0.35rem 1.25rem;
        border: 0;
        border-left: 2px solid rgba(var(--main-rgb), 0.1);
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .navbar-nav-login {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-light-color);
    }

    .navbar-nav-login .nav-link {
        border-radius: var(--radius-sm);
    }

    .account-name {
        max-width: none;
    }

    .auth-layout {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

@media (max-width: 767.98px) {
    .main-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .filter-card {
        padding: 1rem;
    }

    .filter-actions .btn,
    .filter-actions-end {
        width: 100%;
    }

    .filter-actions-end {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-left: 0;
    }

    .filter-actions-end .btn {
        min-width: 0;
    }

    .filter-actions-end .btn[type="submit"] {
        grid-column: 1 / -1;
        order: -1;
    }

    /* Toolbars stack into full-width rows. */
    .flex-start,
    .flex-start > .dropdown {
        width: 100%;
    }

    .flex-start > .dropdown > .btn,
    .flex-start > .dropdown > button {
        flex: 1 1 100%;
        min-width: 0;
    }


    .m-l-auto,
    .margin-left-auto {
        margin-left: 0;
    }

    .mvc-grid-table > table > thead > tr > th,
    .mvc-grid-table > table > tbody > tr > td {
        padding: 0.65rem 0.75rem;
    }

    .mvc-grid-pager {
        justify-content: center;
        gap: 0.25rem;
    }

    .mvc-grid-pager button {
        min-width: 2.2rem;
        height: 2.2rem;
        padding: 0 0.45rem;
    }

    .grid-link span {
        display: none;
    }

    .dashboard-statistics > [class*="col-"],
    .dashboard-graphs > [class*="col-"],
    .row > .col-md-6,
    .row > .col-md-4 {
        margin-bottom: 1rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: 16px;
    }

    .footer-container {
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .brand-text {
        font-size: 1rem;
    }

    .header-logo {
        height: 34px;
    }

    .jumbotron > h1.display-4:first-child > i:first-child,
    .page-title > i:first-child {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 1rem;
    }
}

/* Call details: the page body sits on one white surface. */
.jumbotron.bg-white {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

@media (max-width: 767.98px) {
    .jumbotron.bg-white {
        padding: 1rem;
    }
}

/* A white surface for page content that would otherwise sit straight on the background (About, the error page). */
.page-panel {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.page-panel .table:last-child,
.page-panel > p:last-child {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .page-panel {
        padding: 1rem;
    }
}

/* About: the system facts as labelled tiles, then the licensed features with their transactions folded under them. */
.about-section + .about-section {
    margin-top: 1.25rem;
}

.about-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.about-section-title {
    margin: 0;
    color: var(--main-color);
    font-size: 1.05rem;
    font-weight: 700;
}

.about-help {
    color: var(--muted-color);
    font-size: 0.85rem;
}

.about-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.about-fact {
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-light-color);
    border-radius: var(--radius);
    background: var(--body-background-color);
}

.about-fact dt {
    margin-bottom: 0.25rem;
    color: var(--muted-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.about-fact dd {
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

/* IDs and addresses: monospace, and they wrap rather than push the tile wider. */
.about-code {
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.about-empty {
    margin: 0;
    color: var(--muted-color);
}

.about-features {
    margin-bottom: 0;
    vertical-align: middle;
}

/* Each feature is its own tbody, so Bootstrap's heavy rule between table sections would split every row. */
.about-features > :not(:first-child),
.about-transactions > :not(:first-child) {
    border-top: 0;
}

.about-features > :not(:last-child) > :last-child > *,
.about-transactions > :not(:last-child) > :last-child > * {
    border-bottom-color: var(--border-color);
}

.about-features > thead th {
    border-bottom-color: var(--border-color);
    color: var(--muted-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.about-features > tbody > tr > td {
    border-bottom-color: var(--border-light-color);
}

.about-features > tbody:last-child > tr:last-child > td {
    border-bottom: 0;
}

.about-toggle-cell {
    width: 2.25rem;
    text-align: center;
}

.about-feature-row {
    cursor: pointer;
}

.about-feature-row:hover > td,
.about-feature-row[aria-expanded="true"] > td {
    background: rgba(var(--main-rgb), 0.04);
}

.about-feature-row:focus-visible {
    outline: none;
    box-shadow: inset var(--focus-ring);
}

.about-feature-row[aria-expanded="true"] > td {
    border-bottom-color: transparent;
}

.about-chevron {
    display: inline-block;
    color: var(--muted-color);
    transition: transform 0.15s ease;
}

.about-feature-row[aria-expanded="true"] .about-chevron {
    color: var(--main-color);
    transform: rotate(90deg);
}

.about-details-row > td {
    padding-top: 0;
    background: rgba(var(--main-rgb), 0.04);
}

.about-transactions {
    margin: 0 0 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--surface-color);
    font-size: 0.875rem;
}

.about-transactions > thead th {
    background: var(--body-background-color);
    color: var(--muted-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.about-transactions > tbody > tr:last-child > td {
    border-bottom: 0;
}

.about-transactions td {
    white-space: nowrap;
}

/* Settings panels (MFA). */
.settings-card {
    max-width: 720px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-pill.is-on {
    background: rgba(var(--accent-rgb), 0.2);
    color: #4C6312;
}

.status-pill.is-alert {
    background: rgba(220, 53, 69, 0.12);
    color: #A61E2D;
}

.status-pill.is-off {
    background: rgba(var(--main-rgb), 0.08);
    color: var(--muted-color);
}

.qr-code {
    width: 100%;
    max-width: 260px;
    height: auto;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #fff;
}

.secret-key {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: var(--main-color);
    color: var(--white-color);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    word-break: break-all;
}

/* ----------------------------------------------------------------------------------------------------
   User Management: the tabs of the desktop window as panels, two columns from tablet width up.
   ---------------------------------------------------------------------------------------------------- */

/* The tabs sit straight on the dark Vidicode background, so they get a white bar of their own, like the back link. */
.app-body .um-tabs {
    gap: 0.25rem;
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 16px rgba(10, 8, 40, 0.12);
}

.app-body .um-tabs .nav-link {
    border: 0;
    border-radius: calc(var(--radius) - 0.25rem);
    margin-bottom: 0;
}

.app-body .um-tabs .nav-link:hover,
.app-body .um-tabs .nav-link:focus-visible {
    background: rgba(var(--main-rgb), 0.06);
}

.app-body .um-tabs .nav-link.active {
    background: var(--white-color);
    box-shadow: inset 0 -3px 0 var(--accent-color), 0 1px 4px rgba(10, 8, 40, 0.1);
}

.um-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius);
}

.um-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .um-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .um-columns-groups {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    }
}

.um-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.um-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.um-panel-title {
    margin: 0 0 1rem;
    color: var(--main-color);
    font-size: 1.05rem;
    font-weight: 700;
}

.um-panel-header .um-panel-title {
    margin: 0;
}

.um-help {
    color: var(--muted-color);
    font-size: 0.85rem;
}

/* label beside the box on wide screens, above it on phones */
.um-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.9rem;
}

@media (min-width: 576px) {
    .um-field {
        grid-template-columns: 120px minmax(0, 1fr);
        align-items: center;
        column-gap: 1rem;
    }

    .um-field > .um-help {
        grid-column: 2;
    }
}

.um-field > .form-label {
    margin: 0;
    font-weight: 600;
}

.um-field .form-control[readonly] {
    background: #F8FAFC;
}

.um-phone {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
}

.um-phone .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.um-phone .btn {
    flex: 0 0 auto;
}

.um-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.um-actions form {
    margin: 0;
}

.um-actions-end {
    justify-content: flex-end;
}

/* Manage Groups: the tree panel keeps its own height instead of stretching to the grid, so its buttons stay
   under the tree; the member buttons sit in the grid panel's header. */
.um-columns-groups {
    align-items: start;
}

.um-actions-header {
    margin: 0;
    padding: 0;
}

.um-title-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.um-member-hint {
    margin: -0.25rem 0 1rem;
}

/* The group the members grid is limited to; the x shows every group again. */
.um-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--main-color);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.um-chip .bi {
    font-size: 0.75rem;
}

a.um-chip:hover,
a.um-chip:focus-visible {
    background: rgba(var(--accent-rgb), 0.38);
    color: var(--main-color);
}

.um-chip-static {
    background: rgba(var(--main-rgb), 0.07);
    color: var(--muted-color);
    font-weight: 600;
}

/* the permissions: a ticked box marks the row, as the highlighted rows of the desktop list */
.um-check-list {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.um-check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border-light-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.um-check-item:last-child {
    border-bottom: 0;
}

.um-check-item:hover {
    background: rgba(var(--main-rgb), 0.035);
}

.um-check-item:has(input:checked) {
    background: rgba(var(--accent-rgb), 0.16);
}

.um-check-item .form-check-input {
    flex: 0 0 auto;
    margin: 0;
}

/* roles and the group tree */
.um-list {
    display: flex;
    flex-direction: column;
    min-height: 160px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.um-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    padding-left: calc(0.9rem + var(--um-depth, 0) * 1.25rem);
    border-bottom: 1px solid var(--border-light-color);
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.um-list-item:hover,
.um-list-item:focus-visible {
    background: rgba(var(--main-rgb), 0.05);
    color: var(--main-color);
}

.um-list-item.active {
    background: rgba(var(--accent-rgb), 0.2);
    box-shadow: inset 3px 0 0 var(--accent-color);
    color: var(--main-color);
    font-weight: 700;
}

.um-tree .um-list-item .bi {
    color: var(--muted-color);
}

.um-move {
    display: flex;
    gap: 0.5rem;
    margin: 0;
}

.um-name-form {
    margin-top: 1rem;
}

.um-name-form .um-actions {
    margin-top: 0;
}

.um-panel-grid .mvc-grid-table {
    box-shadow: none;
}

.um-grid {
    margin-top: 0.5rem;
}

/* grid rows that open a user or select a group member */
[data-um-select] {
    cursor: pointer;
}

[data-um-select]:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: -2px;
}

.mvc-grid-table > table > tbody > tr.um-selected > td {
    background: rgba(var(--accent-rgb), 0.2);
}

.mvc-grid-table > table > tbody > tr.um-selected > td:first-child {
    box-shadow: inset 3px 0 0 var(--accent-color);
}

/* Extensions: one row group per group, collapsible, with the two filters above */
.um-extensions {
    max-height: 560px;
    overflow-y: auto;
}

.um-extensions .um-col-id {
    width: 140px;
}

.um-extensions .um-col-action {
    width: 60px;
    text-align: right;
}

.um-extensions .um-col-action form {
    margin: 0;
}

.mvc-grid-table > table > thead > tr.um-filter-row > td {
    padding: 0.5rem 0.75rem;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-color);
}

.um-extensions thead tr:first-child > th {
    position: static;
}

.um-filter-row .form-control {
    min-height: 34px;
}

.um-group-row > th {
    padding: 0 !important;
    background: rgba(var(--main-rgb), 0.04);
    border-bottom: 1px solid var(--border-color);
}

.um-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 0;
    background: transparent;
    color: var(--main-color);
    font-weight: 700;
    text-align: left;
}

.um-group-toggle .bi {
    transition: transform 0.15s ease;
}

.um-group-toggle[aria-expanded="false"] .bi {
    transform: rotate(-90deg);
}

.um-group-count {
    margin-left: auto;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: rgba(var(--main-rgb), 0.08);
    color: var(--muted-color);
    font-size: 0.8rem;
}

.um-collapsed [data-um-extension],
[data-um-extension].um-filtered {
    display: none;
}

.um-range-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
}

@media (min-width: 768px) {
    .um-range-form {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    }

    .um-range-form .um-range-move {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .um-range-form .um-actions {
        grid-column: 4;
        grid-row: 1;
    }
}

.um-range-form .form-label {
    font-weight: 600;
}

.um-range-form .um-actions {
    margin: 0;
    padding: 0;
}

.um-range-move {
    margin: 0;
}

.um-phone-table th {
    color: var(--muted-color);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.um-phone-table td:first-child {
    min-width: 180px;
}

.um-phone-table .form-control-sm,
.um-phone-table .form-select-sm {
    min-height: 36px;
}


/* ----------------------------------------------------------------------------------------------------
   Options: the tabs of the desktop Options window. The tabs, alerts and panels are the User Management ones; the
   property grids become categories of rows, a name with its description beside its editor.
   ---------------------------------------------------------------------------------------------------- */

.opt-form {
    /* room for the save bar, which stays at the bottom of the window */
    padding-bottom: 0.5rem;
}

.opt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.opt-toolbar .um-panel-title {
    flex: 1 1 auto;
    margin: 0;
}

.opt-search {
    position: relative;
    flex: 0 1 320px;
    min-width: 200px;
}

.opt-search > .bi {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    transform: translateY(-50%);
    color: var(--muted-color);
    pointer-events: none;
}

.opt-search .form-control {
    padding-left: 2.3rem;
}

.opt-order {
    gap: 0.25rem;
}

.opt-order .btn-icon.active {
    border-color: var(--main-color);
    background: rgba(var(--main-rgb), 0.08);
    color: var(--main-color);
}

.opt-scope {
    margin: 0 0 1rem;
}

.opt-empty,
.opt-unavailable {
    margin: 0.5rem 0 0;
    color: var(--muted-color);
}

/* A category: its title bar folds it, as the property grid's category rows do. */
.opt-category + .opt-category {
    margin-top: 0.75rem;
}

.opt-category-title {
    margin: 0;
    font-size: inherit;
}

.opt-category-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-light-color);
    border-radius: var(--radius-sm);
    background: var(--body-background-color);
    color: var(--main-color);
    font-weight: 700;
    text-align: left;
}

.opt-category-toggle:hover {
    background: rgba(var(--main-rgb), 0.06);
}

.opt-category-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.opt-category-toggle > .bi-chevron-down {
    transition: transform 0.15s ease;
}

.opt-category-toggle[aria-expanded="false"] > .bi-chevron-down {
    transform: rotate(-90deg);
}

.opt-category-count {
    margin-left: auto;
    padding: 0.05rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--muted-color);
    font-size: 0.78rem;
    font-weight: 600;
}

.opt-category-body,
.opt-flat {
    padding: 0 0.25rem;
}

/* A property: the name and its description, the editor beside them from tablet width up. */
.opt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
    padding: 0.75rem 0.6rem;
    border-bottom: 1px solid var(--border-light-color);
}

.opt-row:last-child {
    border-bottom: 0;
}

@media (min-width: 768px) {
    .opt-row {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        align-items: center;
        column-gap: 1.5rem;
    }
}

/* a changed value is marked at the start of its row until it is saved */
.opt-row.is-changed {
    box-shadow: inset 3px 0 0 var(--accent-color);
    background: rgba(var(--accent-rgb), 0.06);
}

.opt-label {
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

.opt-description {
    margin-top: 0.15rem;
    color: var(--muted-color);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.opt-editor {
    min-width: 0;
}

.opt-switch {
    min-height: 0;
    margin: 0;
}

.opt-switch .form-check-input {
    width: 2.6rem;
    height: 1.35rem;
    cursor: pointer;
}

.opt-switch .form-check-input:checked {
    border-color: var(--main-color);
    background-color: var(--main-color);
}

.opt-clear {
    margin-top: 0.35rem;
    font-size: 0.85rem;
}

/* Save bar: stays at the bottom of the window, and is marked once something has changed. */
.opt-savebar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.opt-changes {
    margin-right: auto;
    color: var(--muted-color);
    font-weight: 600;
}

.opt-form.is-changed .opt-changes {
    color: var(--main-color);
}

.opt-form.is-changed .opt-changes::before {
    content: "";
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.45rem;
    border-radius: 50%;
    background: var(--accent-color);
    vertical-align: 0.05rem;
}

.opt-savebar .btn {
    min-width: 0;
    min-height: 40px;
}

/* Special: two panels side by side from desktop width up, the IVR messages under them. */
.opt-special {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

@media (min-width: 1200px) {
    .opt-special {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .opt-special-wide {
        grid-column: 1 / -1;
    }
}

.opt-special .opt-row {
    padding-left: 0;
    padding-right: 0;
}

.opt-devices {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.opt-device {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border-light-color);
    border-radius: var(--radius-sm);
    background: var(--body-background-color);
}

.opt-device .form-check-input {
    flex: 0 0 auto;
    margin-top: 0.2rem;
}

.opt-device-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
    cursor: pointer;
}

.opt-device-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.opt-device-mac {
    color: var(--muted-color);
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 0.82rem;
}

/* Network credentials: an editable table. */
.opt-credentials {
    min-width: 760px;
    margin-bottom: 0;
    vertical-align: middle;
}

.opt-credentials > thead th {
    color: var(--muted-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.opt-credentials > :not(:first-child) {
    border-top: 0;
}

.opt-credentials td:first-child {
    min-width: 220px;
}

.opt-col-action {
    width: 48px;
    text-align: center;
}

/* Archive > Archive: the Archive tab of the desktop Archive window. */
.arc-form {
    max-width: 760px;
}

.arc-group {
    margin-bottom: 1.25rem;
}

.arc-group .form-check {
    margin-bottom: 0.5rem;
}

/* the dates belong to "Backup from", so they sit under it */
.arc-dates {
    margin: 0.5rem 0 0 1.75rem;
}

.arc-dates .form-control:disabled {
    background: #F1F5F9;
}

.arc-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.arc-note {
    display: flex;
    gap: 0.5rem;
    color: var(--muted-color);
}

/* the custom repeat of a scheduled task: days and hours:minutes */
.arc-custom {
    max-width: 360px;
}

/* the long label of the days a scheduled delete keeps */
@media (min-width: 576px) {
    .arc-field-wide {
        grid-template-columns: 280px minmax(0, 160px);
    }
}

/* scheduled deletes are listed in red, as on the desktop */
.arc-row-delete > td {
    color: var(--bs-danger, #DC3545);
}

.arc-actions {
    gap: 0.5rem;
}

/* the Calls page filter an export takes */
.arc-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
}

.arc-filters span {
    color: var(--muted-color);
}

/* the toolbar of Archive History and Schedule Tasks: on the panel the tabs use, so its label reads on the page background */
.app-body .page-actions.arc-toolbar {
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 16px rgba(10, 8, 40, 0.12);
}

/* the "Type of archive" of the desktop Archive history window */
.arc-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
}

.arc-type .form-select {
    width: auto;
}

/* the desktop status bar */
.arc-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-color);
    color: var(--muted-color);
    font-size: 0.9rem;
}
