* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--tr-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--tr-font-family);
    color: var(--tr-text);
    background:
        radial-gradient(circle at 78% 6%, rgba(38, 103, 255, 0.055), transparent 26%),
        radial-gradient(circle at 18% 76%, rgba(64, 185, 255, 0.035), transparent 28%),
        var(--tr-bg);
    -webkit-font-smoothing: antialiased;
    transition: opacity var(--tr-transition);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.tr-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at 20% 20%, rgba(38, 103, 255, 0.12), transparent 28%),
        radial-gradient(circle at 82% 82%, rgba(38, 103, 255, 0.08), transparent 30%),
        var(--tr-bg);
}

.tr-login-card {
    width: min(100%, 470px);
    padding: 34px;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--tr-shadow-md);
}

.tr-login-brand,
.tr-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tr-login-brand strong,
.tr-sidebar-brand strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
}

.tr-login-brand span:not(.tr-brand-mark),
.tr-sidebar-brand span:not(.tr-brand-mark) {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--tr-text-soft);
}

.tr-brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    background: linear-gradient(135deg, #2d74ff, #174fc7);
    box-shadow: 0 10px 24px rgba(38, 103, 255, 0.26);
}

.tr-login-copy {
    margin: 42px 0 28px;
}

.tr-eyebrow {
    margin: 0 0 8px;
    color: var(--tr-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.tr-login-copy h1,
.tr-page-head h1 {
    margin: 0;
    letter-spacing: -0.04em;
}

.tr-login-copy h1 {
    font-size: 30px;
}

.tr-login-copy p:not(.tr-eyebrow) {
    margin: 12px 0 0;
    color: var(--tr-text-soft);
    font-size: 14px;
    line-height: 1.65;
}

.tr-form {
    display: grid;
    gap: 16px;
}

.tr-field {
    display: grid;
    gap: 8px;
}

.tr-field > span,
.tr-field-label {
    color: var(--tr-text-soft);
    font-size: var(--tr-font-sm);
    font-weight: 700;
}

.tr-field input,
.tr-field textarea,
.tr-search-input,
.tr-control {
    width: 100%;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius-sm);
    background: var(--tr-surface);
    color: var(--tr-text);
    outline: none;
    transition: border-color var(--tr-transition), box-shadow var(--tr-transition), background var(--tr-transition);
}

.tr-field input,
.tr-search-input,
.tr-control {
    min-height: 46px;
    padding: 0 14px;
}

.tr-field textarea {
    min-height: 110px;
    padding: 13px 14px;
    resize: vertical;
}

.tr-field input:focus,
.tr-field textarea:focus,
.tr-search-input:focus,
.tr-control:focus,
.tr-dropdown-button:focus-visible,
.tr-date-range-button:focus-visible {
    border-color: rgba(38, 103, 255, 0.7);
    box-shadow: 0 0 0 4px rgba(38, 103, 255, 0.11);
}

.tr-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    transition: transform var(--tr-transition), background var(--tr-transition), border-color var(--tr-transition), opacity var(--tr-transition);
}

.tr-button:hover {
    transform: translateY(-1px);
}

.tr-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.tr-button--primary {
    color: #fff;
    background: var(--tr-primary);
}

.tr-button--primary:hover {
    background: var(--tr-primary-strong);
}

.tr-button--secondary {
    border-color: var(--tr-border);
    background: var(--tr-surface);
}

.tr-button--secondary:hover {
    border-color: var(--tr-border-strong);
    background: var(--tr-surface-soft);
}


.tr-button--warning {
    color: #8a4b08;
    border-color: rgba(236, 145, 34, 0.34);
    background: #fff0d7;
    box-shadow: 0 8px 22px rgba(236, 145, 34, 0.12);
}

.tr-button--warning:hover {
    color: #713b05;
    border-color: rgba(236, 145, 34, 0.52);
    background: #ffe4b8;
    box-shadow: 0 12px 28px rgba(236, 145, 34, 0.18);
}

.tr-button--full {
    width: 100%;
}

.tr-form-message {
    margin: 0;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.tr-form-message--error {
    color: #9c2534;
    background: var(--tr-danger-soft);
}

.tr-form-message--success {
    color: #197346;
    background: var(--tr-success-soft);
}

.tr-admin-shell {
    min-height: 100vh;
}

.tr-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--tr-sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 22px 18px;
    color: #fff;
    background:
        radial-gradient(circle at 12% 4%, rgba(53, 113, 255, 0.18), transparent 27%),
        linear-gradient(180deg, #101827 0%, #0d1421 100%);
    box-shadow: 18px 0 46px rgba(12, 21, 37, 0.08);
}

.tr-sidebar .tr-sidebar-brand {
    padding: 3px 8px 20px;
}

.tr-sidebar .tr-sidebar-brand span:not(.tr-brand-mark) {
    color: #9eabc0;
}

.tr-sidebar-nav {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.tr-nav-item {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 13px;
    border: 0;
    border-radius: 12px;
    color: #9eabc0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-weight: 650;
    transition: color var(--tr-transition), background var(--tr-transition);
}

.tr-nav-item svg,
.tr-icon-button svg,
.tr-table-link-icon,
.tr-search-icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tr-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
    transform: translateX(2px);
}

.tr-nav-item {
    transition: color var(--tr-transition), background var(--tr-transition), transform var(--tr-transition), box-shadow var(--tr-transition);
}

.tr-nav-item.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(45, 116, 255, 0.26), rgba(38, 103, 255, 0.14));
    box-shadow: inset 0 0 0 1px rgba(99, 145, 255, 0.18);
}

.tr-sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tr-admin-identity {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tr-admin-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(101, 151, 255, 0.52);
    box-shadow: 0 0 0 4px rgba(38, 103, 255, 0.10), 0 8px 20px rgba(0, 0, 0, 0.18);
    background: #26334a;
    transition: transform var(--tr-transition), box-shadow var(--tr-transition);
}

.tr-admin-avatar:hover {
    transform: scale(1.055);
    box-shadow: 0 0 0 4px rgba(38, 103, 255, 0.18), 0 10px 26px rgba(0, 0, 0, 0.22);
}

.tr-admin-identity div {
    min-width: 0;
}

.tr-admin-identity strong,
.tr-admin-identity span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-admin-identity strong {
    font-size: 12px;
}

.tr-admin-identity span {
    margin-top: 2px;
    color: #8f9cb1;
    font-size: 10px;
}

.tr-icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    color: inherit;
    background: transparent;
    cursor: pointer;
    transition: background var(--tr-transition), border-color var(--tr-transition);
}

.tr-sidebar .tr-icon-button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.tr-main {
    min-height: 100vh;
    margin-left: var(--tr-sidebar-width);
}

.tr-mobile-header {
    display: none;
}

.tr-view {
    padding: 34px 34px 50px;
}

.tr-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.tr-page-head h1 {
    font-size: 28px;
}

.tr-page-head p {
    margin: 8px 0 0;
    color: var(--tr-text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.tr-page-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tr-card {
    position: relative;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius-md);
    background: linear-gradient(180deg, rgba(255,255,255,0.995), rgba(252,253,255,0.98));
    box-shadow: var(--tr-shadow-sm);
    transition: transform var(--tr-transition), box-shadow var(--tr-transition), border-color var(--tr-transition);
}

.tr-card:hover {
    border-color: #d8e2f4;
    box-shadow: 0 12px 32px rgba(25, 39, 73, 0.075);
}

.tr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--tr-border);
}

.tr-card-header h2,
.tr-chart-header h2,
.tr-modal-header h2 {
    margin: 0;
    font-size: var(--tr-font-lg);
    line-height: var(--tr-line-tight);
    letter-spacing: -0.02em;
}

.tr-card-header p,
.tr-chart-header p {
    margin: 5px 0 0;
    color: var(--tr-text-soft);
    font-size: var(--tr-font-sm);
    line-height: var(--tr-line-base);
}

.tr-filters {
    display: grid;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--tr-border);
    background: var(--tr-surface-soft);
}

.tr-filters--active {
    grid-template-columns: minmax(260px, 1fr) minmax(250px, 330px);
}

.tr-active-date-filter {
    position: relative;
    min-width: 0;
}

.tr-active-date-filter .tr-date-range-button {
    width: 100%;
    padding-right: 42px;
}

.tr-active-date-clear {
    position: absolute;
    top: 50%;
    right: 30px;
    z-index: 3;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    color: var(--tr-text-soft);
    background: transparent;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.tr-active-date-clear:hover {
    color: var(--tr-primary);
    background: var(--tr-primary-soft);
}

.tr-filters--clients {
    grid-template-columns: minmax(260px, 1fr) repeat(3, 190px);
}

.tr-search-wrap {
    position: relative;
}

.tr-search-wrap .tr-search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--tr-text-faint);
    pointer-events: none;
}

.tr-search-wrap .tr-search-input {
    padding-left: 43px;
}

.tr-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.tr-table-wrap--clients {
    overflow: visible;
}

.tr-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.tr-table--wide {
    min-width: 1500px;
}

.tr-table th,
.tr-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--tr-border);
    text-align: left;
    vertical-align: middle;
}

.tr-table th {
    color: var(--tr-text-soft);
    background: #fbfcff;
    font-size: var(--tr-table-head-size);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tr-table td {
    color: #263249;
    font-size: var(--tr-table-cell-size);
}

.tr-table tbody tr {
    cursor: pointer;
    transition: background var(--tr-transition);
}

.tr-table tbody tr:hover {
    background: #f8faff;
}

.tr-table tbody tr:last-child td {
    border-bottom: 0;
}

.tr-table tbody tr.tr-table-row-static {
    cursor: default;
}

.tr-table tbody tr.tr-table-row-static:hover {
    background: transparent;
}

.tr-cell-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-table a {
    color: var(--tr-primary);
    text-decoration: none;
}

.tr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 25px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
    line-height: 1;
    vertical-align: middle;
}

.tr-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.tr-badge--yes,
.tr-badge--client,
.tr-badge--online {
    color: var(--tr-success);
    background: var(--tr-success-soft);
}

.tr-badge--no,
.tr-badge--denied,
.tr-badge--error {
    color: var(--tr-danger);
    background: var(--tr-danger-soft);
}

.tr-badge--pending,
.tr-badge--offline {
    color: var(--tr-warning);
    background: var(--tr-warning-soft);
}

.tr-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 20px;
    border-top: 1px solid var(--tr-border);
}

.tr-table-count {
    color: var(--tr-text-soft);
    font-size: 11px;
}

.tr-pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tr-pagination button {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--tr-border);
    border-radius: 9px;
    color: var(--tr-text-soft);
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: border-color var(--tr-transition), color var(--tr-transition), background var(--tr-transition);
}

.tr-pagination button:hover:not(:disabled),
.tr-pagination button.is-active {
    color: var(--tr-primary);
    border-color: #bfd1ff;
    background: var(--tr-primary-soft);
}

.tr-pagination button:disabled {
    cursor: default;
    opacity: 0.45;
}

.tr-empty {
    padding: 52px 20px;
    color: var(--tr-text-soft);
    text-align: center;
    font-size: 12px;
}

.tr-skeleton {
    position: relative;
    overflow: hidden;
    min-height: 16px;
    border-radius: 7px;
    background: #edf1f7;
}

.tr-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    animation: tr-shimmer 1.25s infinite;
}

@keyframes tr-shimmer {
    100% {
        transform: translateX(100%);
    }
}

.tr-dropdown {
    position: relative;
}

.tr-dropdown-button,
.tr-date-range-button {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius-sm);
    background: #fff;
    cursor: pointer;
    text-align: left;
    outline: none;
    transition: border-color var(--tr-transition), box-shadow var(--tr-transition);
}

.tr-dropdown-button > span,
.tr-date-range-button > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 650;
}

.tr-dropdown-chevron,
.tr-date-range-chevron {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-right: 1.8px solid var(--tr-text-soft);
    border-bottom: 1.8px solid var(--tr-text-soft);
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--tr-transition);
}

.tr-dropdown.is-open .tr-dropdown-chevron,
.tr-date-range.is-open .tr-date-range-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.tr-dropdown-menu,
.tr-date-range-popover {
    position: absolute;
    z-index: 100;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 250px;
    border: 1px solid var(--tr-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--tr-shadow-md);
    overflow: hidden;
}

.tr-dropdown-search {
    padding: 10px;
    border-bottom: 1px solid var(--tr-border);
}

.tr-dropdown-search input {
    width: 100%;
    height: 39px;
    padding: 0 11px;
    border: 1px solid var(--tr-border);
    border-radius: 9px;
    outline: none;
    font-size: 11px;
}

.tr-dropdown-options {
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
}

.tr-dropdown-option {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: var(--tr-text);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 11px;
    line-height: 1.45;
}

.tr-dropdown-option:hover,
.tr-dropdown-option.is-selected {
    color: var(--tr-primary);
    background: var(--tr-primary-soft);
}


#tr-device-select .tr-dropdown-button > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-dropdown-empty {
    padding: 20px 12px;
    color: var(--tr-text-soft);
    text-align: center;
    font-size: 11px;
}

.tr-toolbar {
    display: grid;
    grid-template-columns: minmax(270px, 430px) minmax(250px, 320px);
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.tr-toolbar--insights {
    grid-template-columns: repeat(3, minmax(190px, 1fr)) minmax(250px, 320px);
}

.tr-toolbar-group {
    display: grid;
    gap: 7px;
}

.tr-toolbar-group > span {
    color: var(--tr-text-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


.tr-device-selector-group {
    align-content: end;
}

.tr-toolbar--devices {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    align-items: end;
    max-width: 900px;
}

.tr-toolbar--devices .tr-toolbar-group {
    align-self: end;
}

.tr-toolbar--devices #tr-device-select,
.tr-toolbar--devices #tr-device-range,
.tr-toolbar--devices .tr-dropdown-button,
.tr-toolbar--devices .tr-date-range-button {
    width: 100%;
}

.tr-toolbar--devices .tr-dropdown-button,
.tr-toolbar--devices .tr-date-range-button {
    min-height: var(--tr-control-height);
}

.tr-device-selection-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-top: 2px;
    color: var(--tr-text-soft);
    font-size: 10px;
    line-height: 1.4;
}

.tr-device-selection-meta[hidden] {
    display: none;
}

.tr-device-selection-meta b {
    color: var(--tr-text);
    font-weight: 700;
}

.tr-device-selection-meta--spacer {
    min-height: 14px;
    visibility: hidden;
    pointer-events: none;
}

.tr-date-range {
    position: relative;
}

.tr-date-range-popover {
    width: 330px;
    padding: 14px;
}

.tr-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tr-calendar-title {
    font-size: 12px;
    font-weight: 800;
}

.tr-calendar-nav {
    display: flex;
    gap: 6px;
}

.tr-calendar-nav button {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border: 1px solid var(--tr-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.tr-calendar-weekdays,
.tr-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.tr-calendar-weekdays span {
    padding: 6px 0;
    color: var(--tr-text-faint);
    text-align: center;
    font-size: 9px;
    font-weight: 800;
}

.tr-calendar-day {
    position: relative;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    z-index: 1;
}

.tr-calendar-day::before {
    content: '';
    position: absolute;
    inset: 3px;
    z-index: -1;
    border-radius: 9px;
}

.tr-calendar-day:hover::before {
    background: var(--tr-surface-blue);
}

.tr-calendar-day.is-muted {
    color: #c5ccd8;
}

.tr-calendar-day.is-range::before {
    inset: 3px 0;
    border-radius: 0;
    background: #edf3ff;
}

.tr-calendar-day.is-start::before,
.tr-calendar-day.is-end::before {
    inset: 3px;
    border-radius: 9px;
    background: var(--tr-primary);
}

.tr-calendar-day.is-start,
.tr-calendar-day.is-end {
    color: #fff;
    font-weight: 800;
}

.tr-calendar-preview {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 11px;
    border-radius: 10px;
    background: var(--tr-surface-soft);
    font-size: 10px;
}

.tr-calendar-preview strong {
    font-size: 10px;
}

.tr-calendar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.tr-calendar-actions .tr-button {
    min-height: var(--tr-control-height-sm);
    font-size: 10px;
}

.tr-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.tr-summary-card {
    padding: 17px;
    border: 1px solid var(--tr-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--tr-shadow-sm);
}

.tr-summary-card > span {
    display: block;
    color: var(--tr-text-soft);
    font-size: var(--tr-font-xs);
    font-weight: 700;
}

.tr-summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: var(--tr-font-stat);
    letter-spacing: -0.04em;
}

.tr-summary-card strong.tr-summary-value--compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.35;
}

.tr-summary-card strong.tr-summary-value--small {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.35;
    white-space: nowrap;
}

.tr-charts-grid {
    display: grid;
    gap: 16px;
}

.tr-chart-card {
    position: relative;
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius-md);
    background: #fff;
    box-shadow: var(--tr-shadow-sm);
}

.tr-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.tr-chart-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--tr-text-soft);
    font-size: 10px;
}

.tr-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tr-chart-legend i {
    width: 8px;
    height: 8px;
    display: block;
    border-radius: 50%;
    background: var(--tr-primary);
}

.tr-chart-legend i.tr-legend-secondary {
    background: #7f92bd;
}

.tr-chart-canvas-wrap {
    position: relative;
    height: 300px;
}

.tr-chart-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.tr-chart-tooltip {
    position: absolute;
    z-index: 6;
    min-width: 150px;
    padding: 10px 11px;
    border: 1px solid rgba(27, 39, 63, 0.08);
    border-radius: 10px;
    color: #fff;
    background: rgba(17, 24, 39, 0.94);
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 12px));
    font-size: 10px;
    line-height: 1.55;
}

.tr-chart-tooltip strong,
.tr-chart-tooltip span {
    display: block;
}

.tr-chart-tooltip strong {
    margin-bottom: 4px;
    font-size: 11px;
}

.tr-client-rides-section {
    margin-top: 18px;
}

.tr-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(13, 21, 35, 0.55);
    backdrop-filter: blur(5px);
}

.tr-modal {
    width: min(900px, 100%);
    max-height: min(860px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(10, 18, 32, 0.25);
    overflow: hidden;
}

.tr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--tr-border);
}

.tr-modal-body {
    overflow-y: auto;
    padding: 22px;
}

.tr-modal-close {
    color: var(--tr-text-soft);
    border-color: var(--tr-border);
    background: #fff;
}

.tr-credentials-panel {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #cfddff;
    border-radius: 14px;
    background: #f5f8ff;
}

.tr-credentials-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.tr-credentials-head h3 {
    margin: 0;
    font-size: 13px;
}

.tr-credentials-head p {
    margin: 5px 0 0;
    color: var(--tr-text-soft);
    font-size: 10px;
    line-height: 1.5;
}

.tr-credentials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.tr-acceptance-policy-panel {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #d8e2f7;
    border-radius: 14px;
    background: #fbfcff;
}

.tr-acceptance-policy-head,
.tr-policy-subsection-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.tr-acceptance-policy-head {
    margin-bottom: 16px;
}

.tr-acceptance-policy-head h3,
.tr-policy-subsection-head h4 {
    margin: 0;
}

.tr-acceptance-policy-head h3 { font-size: var(--tr-section-title-size); }
.tr-policy-subsection-head h4 { font-size: var(--tr-font-md); }

.tr-acceptance-policy-head p,
.tr-policy-subsection-head p {
    margin: 5px 0 0;
    color: var(--tr-text-soft);
    font-size: var(--tr-section-copy-size);
    line-height: var(--tr-line-base);
}

.tr-policy-settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.tr-policy-toggle,
.tr-policy-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    color: var(--tr-text);
    font-size: var(--tr-font-sm);
    font-weight: 700;
}

.tr-policy-toggle input,
.tr-policy-check input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.tr-minimum-amount-field[hidden],
.tr-minimum-ratio-field[hidden] { display: none; }

.tr-field-help {
    color: var(--tr-text-soft);
    font-size: var(--tr-font-xs);
    font-weight: 500;
    line-height: var(--tr-line-base);
}

.tr-policy-status-note {
    grid-column: 1 / -1;
    padding: 9px 11px;
    border: 1px dashed var(--tr-border);
    border-radius: 10px;
    color: var(--tr-text-soft);
    font-size: var(--tr-font-xs);
}

.tr-policy-settings-form > .tr-button { justify-self: start; }

.tr-policy-subsection[hidden] { display: none; }

.tr-policy-subsection {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--tr-border);
}

.tr-working-hours-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tr-space-sm);
    margin: var(--tr-space-md) 0;
}

.tr-working-hours-row {
    display: grid;
    grid-template-columns: minmax(90px, .8fr) repeat(2, minmax(108px, 1fr));
    gap: var(--tr-space-sm);
    align-items: end;
    padding: 8px 10px;
    border: 1px solid var(--tr-border);
    border-radius: 10px;
    background: #fff;
}

.tr-working-hours-row > label:not(.tr-policy-check) span {
    display: block;
    margin-bottom: 5px;
    color: var(--tr-text-soft);
    font-size: var(--tr-font-2xs);
    font-weight: 700;
}

.tr-working-hours-row input[type="time"],
.tr-closed-period-form input {
    width: 100%;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid var(--tr-border);
    border-radius: 9px;
    padding: 7px 9px;
    color: var(--tr-text);
    background: #fff;
    font: inherit;
}

.tr-closed-period-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.tr-closed-period-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 1px solid var(--tr-border);
    border-radius: 10px;
    background: #fff;
}

.tr-closed-period-row strong,
.tr-closed-period-row span { display: block; }
.tr-closed-period-row strong { font-size: 10.5px; }
.tr-closed-period-row span { margin-top: 3px; color: var(--tr-text-soft); font-size: 9.5px; }

.tr-closed-period-actions,
.tr-closed-period-form-actions {
    display: flex;
    gap: 7px;
}

.tr-button--compact {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 9.5px;
}

.tr-policy-empty {
    padding: 11px;
    border: 1px dashed var(--tr-border);
    border-radius: 10px;
    color: var(--tr-text-soft);
    font-size: 10px;
}

.tr-closed-period-form {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.2fr);
    gap: 10px;
    align-items: end;
}

.tr-closed-period-form-actions { grid-column: 1 / -1; }

.tr-closed-period-table-wrap {
    width: 100%;
    margin-top: var(--tr-space-md);
    overflow-x: auto;
    border: 1px solid var(--tr-border);
    border-radius: 11px;
}

.tr-table--closed-periods {
    min-width: 650px;
}

.tr-table--closed-periods th,
.tr-table--closed-periods td {
    padding: 10px 12px;
}

.tr-table--closed-periods td strong {
    font-size: var(--tr-font-sm);
}

.tr-closed-period-table-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--tr-space-xs);
    white-space: nowrap;
}

.tr-closed-period-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tr-space-md);
    margin-top: var(--tr-space-sm);
    color: var(--tr-text-soft);
    font-size: var(--tr-font-xs);
}

.tr-closed-period-pagination > div {
    display: flex;
    align-items: center;
    gap: var(--tr-space-xs);
}

.tr-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tr-detail-item {
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid var(--tr-border);
    border-radius: 11px;
    background: #fbfcff;
}

.tr-detail-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--tr-text-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tr-detail-item strong,
.tr-detail-item a {
    display: block;
    overflow-wrap: anywhere;
    color: var(--tr-text);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

.tr-detail-item a:hover {
    color: var(--tr-primary);
}

.tr-detail-item--full {
    grid-column: 1 / -1;
}

.tr-device-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.tr-toast-root {
    position: fixed;
    z-index: 300;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 8px;
}

.tr-toast {
    min-width: 240px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 11px;
    color: #fff;
    background: #1a2332;
    box-shadow: var(--tr-shadow-md);
    font-size: 11px;
    line-height: 1.5;
    animation: tr-toast-in 180ms ease both;
}

.tr-toast--success {
    background: #197346;
}

.tr-toast--error {
    background: #a53040;
}

@keyframes tr-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.tr-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(11, 18, 30, 0.45);
}


.tr-view.is-entering {
    animation: tr-view-enter 360ms cubic-bezier(.2,.8,.2,1) both;
}

.tr-content-reveal,
.tr-summary-grid > *,
.tr-device-summary > *,
.tr-chart-card,
.tr-client-rides-section:not([hidden]) {
    animation: tr-content-enter 360ms cubic-bezier(.2,.8,.2,1) both;
}

.tr-table tbody tr {
    animation: tr-row-enter 300ms cubic-bezier(.2,.8,.2,1) both;
    transition: background var(--tr-transition), transform var(--tr-transition), box-shadow var(--tr-transition);
}

.tr-table tbody tr:hover {
    transform: translateX(2px);
    box-shadow: inset 3px 0 0 rgba(38, 103, 255, 0.72);
}

.tr-button--primary {
    background: linear-gradient(135deg, #2b6dff 0%, #1f58e8 58%, #315eea 100%);
    box-shadow: 0 8px 22px rgba(38, 103, 255, 0.18);
}

.tr-button--primary:hover {
    background: linear-gradient(135deg, #3477ff, #174fd5);
    box-shadow: 0 12px 28px rgba(38, 103, 255, 0.26);
}

.tr-button-plus {
    font-size: 19px;
    line-height: 1;
}

.tr-dropdown-menu,
.tr-date-range-popover {
    transform-origin: top center;
}

.tr-dropdown.is-open .tr-dropdown-menu,
.tr-date-range.is-open .tr-date-range-popover {
    animation: tr-popover-in 190ms cubic-bezier(.2,.8,.2,1) both;
}

.tr-calendar-day,
.tr-calendar-nav button,
.tr-dropdown-option {
    transition: transform var(--tr-transition), color var(--tr-transition), background var(--tr-transition), opacity var(--tr-transition);
}

.tr-calendar-day:hover:not(:disabled),
.tr-calendar-nav button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.tr-calendar-day.is-disabled,
.tr-calendar-day:disabled {
    color: #d7dde8;
    cursor: not-allowed;
    opacity: 0.5;
}

.tr-calendar-day.is-disabled::before,
.tr-calendar-day:disabled::before {
    background: transparent !important;
}

.tr-calendar-nav button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.tr-summary-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% -10%, rgba(38,103,255,.11), transparent 36%),
        linear-gradient(180deg, #fff 0%, #fbfdff 100%);
    transition: transform var(--tr-transition), border-color var(--tr-transition), box-shadow var(--tr-transition);
}

.tr-summary-card::after {
    content: '';
    position: absolute;
    width: 74px;
    height: 74px;
    right: -28px;
    bottom: -32px;
    border: 1px solid rgba(38, 103, 255, 0.09);
    border-radius: 50%;
}

.tr-summary-card:hover {
    transform: translateY(-3px);
    border-color: rgba(38, 103, 255, 0.24);
    box-shadow: 0 16px 34px rgba(38, 103, 255, 0.09);
}

.tr-chart-card {
    overflow: hidden;
    background:
        radial-gradient(circle at 92% -20%, rgba(38, 103, 255, 0.10), transparent 34%),
        linear-gradient(180deg, #fff 0%, #fbfdff 100%);
    transition: transform var(--tr-transition), box-shadow var(--tr-transition), border-color var(--tr-transition);
}

.tr-chart-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(38, 103, 255, 0.72), rgba(64, 185, 255, 0.58), transparent);
    opacity: 0.75;
}

.tr-chart-card:hover {
    transform: translateY(-2px);
    border-color: rgba(38, 103, 255, 0.22);
    box-shadow: 0 18px 42px rgba(25, 39, 73, 0.09);
}

.tr-chart-tooltip {
    border-color: rgba(103, 151, 255, 0.25);
    background: rgba(13, 22, 39, 0.95);
    box-shadow: 0 18px 38px rgba(10, 18, 32, 0.26), 0 0 0 1px rgba(38, 103, 255, 0.08);
    backdrop-filter: blur(10px);
    animation: tr-tooltip-in 120ms ease both;
}

.tr-modal-backdrop {
    opacity: 0;
    transition: opacity 180ms ease;
}

.tr-modal-backdrop.is-visible {
    opacity: 1;
}

.tr-modal-backdrop.is-closing {
    opacity: 0;
}

.tr-modal {
    transform: translateY(14px) scale(0.985);
    opacity: 0;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease;
}

.tr-modal-backdrop.is-visible .tr-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.tr-modal-backdrop.is-closing .tr-modal {
    transform: translateY(8px) scale(0.99);
    opacity: 0;
}

.tr-modal--wide {
    width: min(1120px, 100%);
}

.tr-client-editor {
    min-width: 0;
}

.tr-client-editor-form {
    display: grid;
    gap: 18px;
}

/* Active-client modal: one consistent visual flow while preserving form semantics. */
.tr-client-active-modal-body {
    display: grid;
    gap: var(--tr-space-lg);
}

.tr-client-active-modal-body > .tr-credentials-panel { order: 10; margin-bottom: 0; }
.tr-client-active-modal-body > .tr-acceptance-policy-panel { order: 40; margin-bottom: 0; }
.tr-client-active-modal-body > .tr-client-editor,
.tr-client-active-modal-body .tr-client-editor-form { display: contents; }
.tr-client-active-modal-body .tr-client-editor-id { display: none; }
.tr-client-active-modal-body .tr-editor-section--note { order: 20; }
.tr-client-active-modal-body .tr-editor-section--status { order: 30; }
.tr-client-active-modal-body .tr-editor-section--business { order: 50; }
.tr-client-active-modal-body .tr-editor-section--runtime { order: 60; }
.tr-client-active-modal-body .tr-editor-section--metadata { order: 70; }
.tr-client-active-modal-body .tr-form-message { order: 80; }
.tr-client-active-modal-body .tr-editor-actions { order: 90; }
.tr-client-active-modal-body .tr-delete-confirm { order: 100; }
.tr-client-active-modal-body .tr-editor-section-head > span { display: none; }

.tr-client-editor-id {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #dce6f7;
    border-radius: 12px;
    background: linear-gradient(90deg, #f7faff, #fbfdff);
}

.tr-client-editor-id span {
    color: var(--tr-text-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tr-client-editor-id strong {
    color: var(--tr-primary);
    font-size: 13px;
}

.tr-editor-section {
    padding: 18px;
    border: 1px solid var(--tr-border);
    border-radius: 15px;
    background: linear-gradient(180deg, #fff, #fbfcff);
    transition: border-color var(--tr-transition), box-shadow var(--tr-transition), transform var(--tr-transition);
}

.tr-editor-section:hover {
    border-color: #d6e2f6;
    box-shadow: 0 12px 30px rgba(31, 58, 109, 0.055);
}

.tr-editor-section-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 15px;
}

.tr-editor-section-head > span {
    min-width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(38, 103, 255, 0.18);
    border-radius: 9px;
    color: var(--tr-primary);
    background: var(--tr-primary-soft);
    font-size: 9px;
    font-weight: 850;
}

.tr-editor-section-head h3 {
    margin: 1px 0 0;
    font-size: var(--tr-section-title-size);
}

.tr-editor-section-head p {
    margin: 4px 0 0;
    color: var(--tr-text-soft);
    font-size: var(--tr-section-copy-size);
    line-height: var(--tr-line-base);
}

.tr-editor-section-head--with-action > div {
    flex: 1 1 auto;
    min-width: 0;
}

.tr-editor-section-head--with-action .tr-button {
    flex: 0 0 auto;
    margin-left: auto;
}

.tr-button--compact {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 10px;
}

.tr-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tr-editor-field--full {
    grid-column: 1 / -1;
}

.tr-editor-actions {
    position: sticky;
    bottom: -22px;
    z-index: 4;
    display: flex;
    justify-content: flex-end;
    padding: 18px 18px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}

.tr-loading-pulse {
    animation: tr-soft-pulse 1.05s ease-in-out infinite alternate;
}

.tr-toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 180ms ease, transform 180ms ease;
}

body.is-auth-transition {
    opacity: .45;
}

@keyframes tr-view-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tr-content-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tr-row-enter {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tr-popover-in {
    from { opacity: 0; transform: translateY(-5px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tr-tooltip-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tr-soft-pulse {
    from { opacity: .55; }
    to { opacity: 1; }
}



/* Quick table editing */
.tr-cell-website .tr-table-website {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tr-primary);
    text-decoration: none;
    transition: color var(--tr-transition), transform var(--tr-transition);
}

.tr-cell-website .tr-table-website:hover {
    color: var(--tr-primary-strong);
    text-decoration: underline;
}

.tr-inline-editor {
    position: relative;
    min-width: 112px;
}

.tr-inline-editor .tr-dropdown-button {
    min-height: 32px;
    padding: 0 10px;
    border-color: transparent;
    border-radius: 999px;
    background: var(--tr-surface-soft);
}

.tr-inline-editor--bool .tr-dropdown-button {
    color: #b83748;
    background: var(--tr-danger-soft);
}

.tr-inline-editor--status .tr-dropdown-button {
    color: #a46b00;
    background: #fff6e3;
}

.tr-inline-editor .tr-dropdown-button:hover,
.tr-inline-editor.is-open .tr-dropdown-button {
    border-color: rgba(38, 103, 255, 0.22);
    box-shadow: 0 5px 18px rgba(32, 56, 104, 0.08);
}

.tr-inline-editor .tr-dropdown-menu {
    min-width: 170px;
    width: max-content;
}

.tr-inline-editor.is-saving,
.tr-cell-note.is-saving {
    opacity: .55;
    pointer-events: none;
}

.tr-inline-note-button {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    border: 0;
    border-radius: 8px;
    color: var(--tr-text);
    background: transparent;
    cursor: text;
    text-align: left;
    transition: background var(--tr-transition), color var(--tr-transition);
}

.tr-inline-note-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-inline-note-button i {
    flex: 0 0 auto;
    color: var(--tr-text-faint);
    font-style: normal;
    opacity: 0;
    transition: opacity var(--tr-transition), color var(--tr-transition);
}

.tr-inline-note-button:hover {
    color: var(--tr-primary);
    background: var(--tr-primary-soft);
}

.tr-inline-note-button:hover i {
    color: var(--tr-primary);
    opacity: 1;
}

.tr-inline-note-form {
    min-width: 240px;
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 30px 30px;
    gap: 5px;
    align-items: center;
}

.tr-inline-note-form input {
    width: 100%;
    height: 32px;
    padding: 0 9px;
    border: 1px solid rgba(38, 103, 255, 0.55);
    border-radius: 8px;
    outline: none;
    box-shadow: 0 0 0 3px rgba(38, 103, 255, 0.09);
}

.tr-inline-note-action {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--tr-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: transform var(--tr-transition), border-color var(--tr-transition), background var(--tr-transition);
}

.tr-inline-note-action:hover {
    transform: translateY(-1px);
    border-color: rgba(38, 103, 255, 0.35);
}

.tr-inline-note-save {
    color: #137b49;
    background: var(--tr-success-soft);
}

.tr-inline-note-cancel {
    color: var(--tr-danger);
    background: var(--tr-danger-soft);
}

/* Custom date + time picker used by every datetime field */
.tr-date-time {
    position: relative;
}

.tr-date-time-button {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius-sm);
    color: var(--tr-text);
    background: #fff;
    cursor: pointer;
    text-align: left;
    outline: none;
    transition: border-color var(--tr-transition), box-shadow var(--tr-transition), background var(--tr-transition);
}

.tr-date-time-button.is-empty {
    color: var(--tr-text-faint);
}

.tr-date-time-button:focus-visible,
.tr-date-time.is-open .tr-date-time-button {
    border-color: rgba(38, 103, 255, 0.7);
    box-shadow: 0 0 0 4px rgba(38, 103, 255, 0.11);
}

.tr-date-time-icon {
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 1.6px solid var(--tr-text-soft);
    border-radius: 4px;
}

.tr-date-time-icon::before,
.tr-date-time-icon::after {
    content: '';
    position: absolute;
}

.tr-date-time-icon::before {
    left: 2px;
    right: 2px;
    top: 4px;
    border-top: 1.5px solid var(--tr-text-soft);
}

.tr-date-time-icon::after {
    width: 4px;
    height: 4px;
    right: 2px;
    bottom: 2px;
    border-radius: 50%;
    background: var(--tr-primary);
}

.tr-date-time-popover {
    position: absolute;
    z-index: 320;
    top: calc(100% + 8px);
    left: 0;
    width: 330px;
    padding: 14px;
    border: 1px solid var(--tr-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--tr-shadow-md);
    transform-origin: top center;
}

.tr-date-time.is-open .tr-date-time-popover {
    animation: tr-popover-in 190ms cubic-bezier(.2,.8,.2,1) both;
}

.tr-date-time.is-upward .tr-date-time-popover {
    top: auto;
    bottom: calc(100% + 8px);
    transform-origin: bottom center;
}

.tr-date-time-time {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 11px;
    border: 1px solid var(--tr-border);
    border-radius: 10px;
    background: var(--tr-surface-soft);
}

.tr-date-time-time > span {
    color: var(--tr-text-soft);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.tr-time-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tr-time-part {
    width: 46px !important;
    min-height: 34px !important;
    height: 34px;
    padding: 0 8px !important;
    border-radius: 8px !important;
    text-align: center;
    font-weight: 800;
}

.tr-date-time-preview {
    grid-template-columns: 1fr;
}

.tr-date-time-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
}

.tr-button--ghost {
    justify-self: start;
    color: var(--tr-text-soft);
    background: transparent;
}

.tr-button--ghost:hover {
    color: var(--tr-primary);
    background: var(--tr-primary-soft);
}

/* Destructive client action */
.tr-button--danger-soft {
    margin-right: auto;
    color: var(--tr-danger);
    border-color: rgba(217, 75, 91, 0.18);
    background: var(--tr-danger-soft);
}

.tr-button--danger-soft:hover {
    border-color: rgba(217, 75, 91, 0.34);
    background: #ffe7eb;
}

.tr-button--danger {
    color: #fff;
    background: var(--tr-danger);
    box-shadow: 0 8px 22px rgba(217, 75, 91, 0.18);
}

.tr-button--danger:hover {
    background: #c83f50;
    box-shadow: 0 12px 28px rgba(217, 75, 91, 0.23);
}

.tr-delete-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border: 1px solid rgba(217, 75, 91, 0.2);
    border-radius: 13px;
    background: linear-gradient(135deg, #fff7f8, #fff0f2);
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.tr-delete-confirm.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tr-delete-confirm strong {
    font-size: 12px;
}

.tr-delete-confirm p {
    margin: 4px 0 0;
    color: var(--tr-text-soft);
    font-size: 10px;
    line-height: 1.5;
}

.tr-delete-confirm-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1180px) {
    .tr-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tr-device-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .tr-table-wrap--clients {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .tr-sidebar {
        transform: translateX(-100%);
        transition: transform 220ms ease;
    }

    .tr-sidebar.is-open {
        transform: translateX(0);
    }

    .tr-main {
        margin-left: 0;
    }

    .tr-mobile-header {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        align-items: center;
        gap: 10px;
        height: 64px;
        padding: 0 18px;
        border-bottom: 1px solid var(--tr-border);
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(14px);
    }

    .tr-sidebar-brand--mobile {
        gap: 9px;
    }

    .tr-sidebar-brand--mobile .tr-brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 15px;
    }

    .tr-view {
        padding: 24px 20px 40px;
    }

    .tr-filters {
        grid-template-columns: 1fr 1fr;
    }

    .tr-search-wrap {
        grid-column: 1 / -1;
    }

    .tr-toolbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .tr-login-shell {
        padding: 18px;
    }

    .tr-login-card {
        padding: 26px 22px;
    }

    .tr-page-head {
        display: block;
    }

    .tr-page-head-actions {
        margin-top: 14px;
    }

    .tr-filters {
        grid-template-columns: 1fr;
    }

    .tr-search-wrap {
        grid-column: auto;
    }

    .tr-summary-grid,
    .tr-device-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tr-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .tr-pagination {
        flex-wrap: wrap;
    }

    .tr-credentials-grid,
    .tr-detail-grid,
    .tr-editor-grid {
        grid-template-columns: 1fr;
    }

    .tr-editor-field--full {
        grid-column: auto;
    }

    .tr-detail-item--full {
        grid-column: auto;
    }

    .tr-date-range-popover {
        width: min(330px, calc(100vw - 40px));
    }

    .tr-modal-backdrop {
        padding: 12px;
    }

    .tr-modal {
        max-height: calc(100vh - 24px);
    }
}

@media (max-width: 480px) {
    .tr-view {
        padding: 20px 14px 34px;
    }

    .tr-summary-grid,
    .tr-device-summary {
        grid-template-columns: 1fr;
    }

    .tr-chart-card {
        padding: 16px 12px;
    }

    .tr-chart-canvas-wrap {
        height: 260px;
    }
}

/* Client table selection, bulk actions and portal dropdowns */
.tr-dropdown-menu--portal {
    z-index: 10050 !important;
    max-width: min(360px, calc(100vw - 20px));
}

.tr-dropdown-menu--portal:not([hidden]) {
    animation: tr-popover-in 190ms cubic-bezier(.2,.8,.2,1) both;
}

.tr-table--clients th,
.tr-table--clients td {
    position: relative;
}

.tr-table--clients tbody tr.is-selected {
    background: linear-gradient(90deg, rgba(38, 103, 255, 0.075), rgba(38, 103, 255, 0.025));
}

.tr-table--clients tbody tr.is-selected td:first-child {
    box-shadow: inset 3px 0 0 var(--tr-primary);
}

.tr-select-cell {
    width: 48px;
    padding-left: 14px !important;
    padding-right: 8px !important;
    text-align: center !important;
}

.tr-check-wrap {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.tr-check-wrap input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tr-check-wrap span {
    width: 17px;
    height: 17px;
    display: block;
    border: 1px solid #cdd7e8;
    border-radius: 5px;
    background: #fff;
    box-shadow: inset 0 0 0 2px #fff;
    transition: border-color var(--tr-transition), background var(--tr-transition), box-shadow var(--tr-transition), transform var(--tr-transition);
}

.tr-check-wrap:hover span {
    border-color: rgba(38, 103, 255, .55);
    transform: scale(1.04);
}

.tr-check-wrap input:checked + span,
.tr-check-wrap input:indeterminate + span {
    border-color: var(--tr-primary);
    background: var(--tr-primary);
    box-shadow: inset 0 0 0 3px #fff;
}

.tr-delete-cell {
    width: 72px;
    text-align: center !important;
}

.tr-quick-delete {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(210, 54, 76, .16);
    border-radius: 9px;
    color: var(--tr-danger);
    background: var(--tr-danger-soft);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: transform var(--tr-transition), border-color var(--tr-transition), background var(--tr-transition), box-shadow var(--tr-transition);
}

.tr-quick-delete:hover {
    transform: translateY(-1px);
    border-color: rgba(210, 54, 76, .34);
    background: #ffe8ec;
    box-shadow: 0 7px 18px rgba(210, 54, 76, .10);
}

.tr-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(38, 103, 255, .13);
    background: linear-gradient(90deg, rgba(38, 103, 255, .075), rgba(255, 255, 255, .94));
    animation: tr-content-enter 180ms ease both;
}

.tr-bulk-bar[hidden] {
    display: none !important;
}

.tr-bulk-bar.is-saving {
    opacity: .6;
    pointer-events: none;
}

.tr-bulk-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.tr-bulk-count strong {
    color: var(--tr-primary);
    font-size: 18px;
}

.tr-bulk-count span {
    color: var(--tr-text-soft);
    font-size: 11px;
    font-weight: 700;
}

.tr-bulk-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.tr-bulk-actions > .tr-dropdown {
    width: 180px;
}

.tr-bulk-actions .tr-dropdown-button {
    min-height: 38px;
}

.tr-confirm-panel {
    padding: 8px 2px 4px;
    text-align: center;
}

.tr-confirm-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--tr-danger);
    background: var(--tr-danger-soft);
    font-size: 22px;
    font-weight: 850;
}

.tr-confirm-panel h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.tr-confirm-panel p {
    max-width: 520px;
    margin: 0 auto;
    color: var(--tr-text-soft);
    font-size: 12px;
    line-height: 1.65;
}

.tr-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-top: 20px;
}

.tr-insights-empty .tr-empty {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tr-insights-empty .tr-empty strong {
    color: var(--tr-text);
    font-size: 15px;
}

.tr-insights-empty .tr-empty span {
    color: var(--tr-text-soft);
    font-size: 11px;
}

/* Client table layout, live result totals and responsive containment */
.tr-card {
    min-width: 0;
}

.tr-results-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 38px;
    padding: 0 20px 12px;
    color: var(--tr-text-soft);
    font-size: 11px;
    font-weight: 700;
}

.tr-results-summary strong {
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border: 1px solid rgba(38, 103, 255, .15);
    border-radius: 999px;
    color: var(--tr-primary);
    background: rgba(38, 103, 255, .07);
    font-size: 12px;
    font-weight: 850;
    transition: transform var(--tr-transition), background var(--tr-transition), box-shadow var(--tr-transition);
}

.tr-results-summary.is-updated strong {
    animation: tr-result-count-pulse 260ms ease both;
}

@keyframes tr-result-count-pulse {
    0% { transform: scale(.94); background: rgba(38, 103, 255, .14); }
    100% { transform: scale(1); background: rgba(38, 103, 255, .07); }
}

.tr-table-wrap--clients {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.tr-table--clients {
    width: 100%;
    min-width: 1320px;
    table-layout: fixed;
}

.tr-table--clients .tr-select-cell {
    width: 48px;
}

.tr-table--clients th:nth-child(2),
.tr-table--clients td:nth-child(2) { width: 125px; }
.tr-table--clients th:nth-child(3),
.tr-table--clients td:nth-child(3) { width: 145px; }
.tr-table--clients th:nth-child(4),
.tr-table--clients td:nth-child(4) { width: 145px; }
.tr-table--clients th:nth-child(5),
.tr-table--clients td:nth-child(5) { width: 165px; }
.tr-table--clients th:nth-child(6),
.tr-table--clients td:nth-child(6) { width: 160px; }
.tr-table--clients th:nth-child(7),
.tr-table--clients td:nth-child(7) { width: 155px; }
.tr-table--clients th:nth-child(8),
.tr-table--clients td:nth-child(8) { width: 170px; }
.tr-table--clients th:nth-child(9),
.tr-table--clients td:nth-child(9) { width: 170px; }

.tr-table--clients .tr-select-cell {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #fff;
}

.tr-table--clients thead .tr-select-cell {
    z-index: 7;
    background: #fbfcff;
}

.tr-table--clients .tr-delete-cell {
    position: sticky;
    right: 0;
    z-index: 4;
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    padding-left: 10px !important;
    padding-right: 10px !important;
    background: #fff;
    box-shadow: -10px 0 18px -18px rgba(28, 43, 70, .7);
}

.tr-table--clients thead .tr-delete-cell {
    z-index: 7;
    background: #fbfcff;
    white-space: nowrap;
}

.tr-table--clients tbody tr:hover .tr-select-cell,
.tr-table--clients tbody tr:hover .tr-delete-cell {
    background: #f8faff;
}

.tr-table--clients tbody tr.is-selected .tr-select-cell,
.tr-table--clients tbody tr.is-selected .tr-delete-cell {
    background: #f5f8ff;
}

@media (max-width: 1180px) {
    .tr-card-header {
        flex-wrap: wrap;
    }

    .tr-bulk-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .tr-bulk-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 980px) {
    .tr-table--clients {
        min-width: 1260px;
    }

    .tr-results-summary {
        justify-content: flex-start;
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 720px) {
    .tr-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .tr-card-header .tr-button {
        width: 100%;
    }

    .tr-results-summary {
        padding: 0 14px 12px;
    }

    .tr-bulk-bar {
        padding: 12px 14px;
    }

    .tr-bulk-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tr-bulk-actions > .tr-dropdown,
    .tr-bulk-actions > .tr-button {
        width: 100%;
    }

    .tr-table-footer {
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 480px) {
    .tr-results-summary {
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .tr-table--clients {
        min-width: 1200px;
    }
}

/* Password visibility controls */
.tr-password-wrap {
    position: relative;
    display: block;
    min-width: 0;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

.tr-password-wrap input {
    padding-right: 46px !important;
}

.tr-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #7d899b;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color var(--tr-transition), background var(--tr-transition), transform var(--tr-transition);
}

.tr-password-toggle:hover,
.tr-password-toggle.is-visible {
    color: var(--tr-primary);
    background: rgba(38, 103, 255, .08);
}

.tr-password-toggle:active {
    transform: translateY(-50%) scale(.95);
}

.tr-password-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Stored Transfeero credentials preview */
.tr-credentials-saved {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.tr-credentials-saved > div {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid rgba(38, 103, 255, .14);
    border-radius: 11px;
    background: rgba(255, 255, 255, .78);
}

.tr-credentials-saved span {
    display: block;
    margin-bottom: 5px;
    color: var(--tr-text-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.tr-credentials-saved strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--tr-text);
    font-size: 11px;
    line-height: 1.45;
}

.tr-credentials-saved strong.is-empty {
    color: var(--tr-text-soft);
    font-style: italic;
    font-weight: 600;
}

.tr-credential-password-mask {
    letter-spacing: .13em;
}

/* Read-only client reports */
.tr-editor-section--reports {
    background: linear-gradient(180deg, #fbfcff, #f7f9fd);
}

.tr-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tr-report-item {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #e1e7f0;
    border-radius: 11px;
    background: rgba(255, 255, 255, .72);
}

.tr-report-item--full {
    grid-column: 1 / -1;
}

.tr-report-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--tr-text-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.tr-report-item strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--tr-text);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.tr-report-item strong.is-empty {
    color: #8994a5;
    font-style: italic;
    font-weight: 600;
}

/* Device management */
.tr-device-manager-card {
    margin-bottom: 16px;
}

.tr-device-manager {
    padding: 0 20px 20px;
}

.tr-device-manager-list {
    display: grid;
    gap: 8px;
}

.tr-device-manager-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) minmax(260px, 1.8fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 13px;
    border: 1px solid var(--tr-border);
    border-radius: 12px;
    background: #fff;
    transition: transform var(--tr-transition), border-color var(--tr-transition), box-shadow var(--tr-transition), opacity var(--tr-transition), background var(--tr-transition);
}

.tr-device-manager-row:hover {
    transform: translateY(-1px);
    border-color: #d5e0f2;
    box-shadow: 0 9px 22px rgba(31, 58, 109, .055);
}

.tr-device-manager-row.is-inactive {
    opacity: .68;
    background: #f8f9fb;
}

.tr-device-manager-main,
.tr-device-manager-meta {
    min-width: 0;
}

.tr-device-manager-main strong,
.tr-device-manager-main span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-device-manager-main strong {
    margin-bottom: 4px;
    font-size: 12px;
}

.tr-device-manager-main span,
.tr-device-manager-meta {
    color: var(--tr-text-soft);
    font-size: 10px;
}

.tr-device-manager-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tr-device-manager-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.tr-button--compact {
    min-height: 34px;
    padding: 0 11px;
    font-size: 10px;
}

/* Client table now uses one note field only */
.tr-table--clients {
    min-width: 1160px;
}

.tr-table--clients th:nth-child(6),
.tr-table--clients td:nth-child(6) { width: 155px; }
.tr-table--clients th:nth-child(7),
.tr-table--clients td:nth-child(7) { width: 165px; }
.tr-table--clients th:nth-child(8),
.tr-table--clients td:nth-child(8) { width: 190px; }

@media (max-width: 980px) {
    .tr-device-manager-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tr-device-manager-actions {
        justify-content: flex-start;
    }

    .tr-table--clients {
        min-width: 1120px;
    }
}

@media (max-width: 720px) {
    .tr-credentials-saved,
    .tr-report-grid {
        grid-template-columns: 1fr;
    }

    .tr-device-manager {
        padding-left: 14px;
        padding-right: 14px;
    }

    .tr-device-manager-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .tr-device-manager-actions .tr-button {
        width: 100%;
    }
}

/* Active-client report spacing */
.tr-editor-report-block {
    margin-bottom: 14px;
}

.tr-editor-note-grid {
    margin-top: 0;
}


/* Client contact status: only on the main Clients table. */
.tr-table--clients .tr-contacted-cell {
    width: 165px;
    min-width: 165px;
    max-width: 165px;
}

.tr-table--clients .tr-contacted-cell .tr-dropdown-button {
    min-width: 118px;
}

.tr-table--clients-contacted {
    min-width: 1325px;
}

@media (max-width: 980px) {
    .tr-table--clients-contacted {
        min-width: 1280px;
    }
}


/* Client interest checkbox + dedicated last-modified timestamp. */
.tr-table--clients .tr-interested-cell {
    width: 178px;
    min-width: 178px;
    max-width: 178px;
}

.tr-interest-control {
    display: inline-grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 6px 9px;
    min-width: 0;
    cursor: pointer;
    user-select: none;
}

.tr-interest-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tr-interest-box {
    grid-row: 1;
    grid-column: 1;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 1px solid #cbd8ec;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(28, 57, 111, .06);
    transition: border-color var(--tr-transition), background var(--tr-transition), box-shadow var(--tr-transition), transform var(--tr-transition);
}

.tr-interest-box::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(.35);
    opacity: 0;
    transition: opacity var(--tr-transition), transform var(--tr-transition);
}

.tr-interest-control:hover .tr-interest-box {
    border-color: rgba(38, 103, 255, .55);
    box-shadow: 0 4px 12px rgba(38, 103, 255, .12);
}

.tr-interest-control input:checked + .tr-interest-box {
    border-color: var(--tr-primary);
    background: var(--tr-primary);
}

.tr-interest-control input:checked + .tr-interest-box::after {
    opacity: 1;
    transform: rotate(-45deg) scale(1);
}

.tr-interest-control input:focus-visible + .tr-interest-box {
    outline: 3px solid rgba(38, 103, 255, .16);
    outline-offset: 2px;
}

.tr-interest-control small {
    grid-column: 1 / -1;
    color: var(--tr-text-soft);
    font-size: 9px;
    line-height: 1.35;
    white-space: normal;
}

.tr-interest-control.is-saving,
.tr-interested-cell.is-saving {
    opacity: .58;
    pointer-events: none;
}

.tr-interest-control--modal {
    width: 100%;
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 11px 12px;
    border: 1px solid var(--tr-border);
    border-radius: 11px;
    background: #fff;
}

.tr-interest-control--modal::after {
    content: 'Ναι / Όχι';
    grid-column: 2;
    grid-row: 1;
    color: var(--tr-text);
    font-size: 12px;
    font-weight: 700;
}

.tr-interest-control--modal small {
    margin-top: 1px;
}

.tr-table--clients-contacted {
    min-width: 1505px;
}

@media (max-width: 980px) {
    .tr-table--clients-contacted {
        min-width: 1460px;
    }
}

/* Active-client activation timestamp: read-only table/report field. */
.tr-table--clients-active {
    min-width: 1555px;
}

.tr-table--clients-active .tr-runtime-status-cell {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
}

.tr-runtime-status-wrap {
    display: grid;
    gap: var(--tr-space-2xs);
    min-width: 0;
}

.tr-runtime-status-wrap small {
    overflow: hidden;
    color: var(--tr-text-faint);
    font-size: var(--tr-font-2xs);
    font-weight: 650;
    line-height: var(--tr-line-tight);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-runtime-status {
    display: inline-flex;
    align-items: center;
    gap: var(--tr-space-xs);
    width: fit-content;
    max-width: 100%;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: var(--tr-pill-size);
    font-weight: 800;
    line-height: var(--tr-line-tight);
    white-space: nowrap;
}

.tr-runtime-status i {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tr-runtime-status--ok {
    color: var(--tr-success);
    background: var(--tr-success-soft);
}

.tr-runtime-status--check {
    color: var(--tr-warning);
    background: var(--tr-warning-soft);
}

.tr-runtime-status--action {
    color: var(--tr-danger);
    background: var(--tr-danger-soft);
}

.tr-table--clients-active tbody tr.is-runtime-attention,
.tr-table--clients-active tbody tr.is-runtime-attention:hover,
.tr-table--clients-active tbody tr.is-runtime-attention .tr-select-cell {
    background: var(--tr-danger-soft);
}

.tr-table--clients-active tbody tr.is-runtime-attention {
    box-shadow: inset 4px 0 0 var(--tr-danger);
}

.tr-table--clients-active tbody tr.is-runtime-check,
.tr-table--clients-active tbody tr.is-runtime-check:hover,
.tr-table--clients-active tbody tr.is-runtime-check .tr-select-cell {
    background: var(--tr-warning-soft);
}

.tr-table--clients .tr-activated-cell {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
}

.tr-readonly-date {
    display: inline-block;
    color: var(--tr-text);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.tr-readonly-date.is-empty {
    color: var(--tr-text-faint);
    font-weight: 600;
}

@media (max-width: 980px) {
    .tr-table--clients-active {
        min-width: 1510px;
    }
}


/* Immediate-interest admin flag: Clients page only. */
.tr-filters--clients {
    grid-template-columns: minmax(260px, 1fr) repeat(4, minmax(155px, 180px));
}

.tr-filters--active {
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 280px) minmax(155px, 210px) minmax(120px, 160px) minmax(135px, 170px);
}

.tr-table--clients .tr-high-interest-cell {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    text-align: center;
}

.tr-interest-control--compact {
    display: inline-grid;
    grid-template-columns: 22px;
    justify-content: center;
    min-width: 22px;
}

.tr-table--clients-contacted {
    min-width: 1660px;
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable),
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable):hover,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable).is-selected {
    background: var(--tr-primary);
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) td,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable):hover td,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable).is-selected td,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-select-cell,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable):hover .tr-select-cell,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable).is-selected .tr-select-cell,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-delete-cell,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable):hover .tr-delete-cell,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable).is-selected .tr-delete-cell {
    color: #fff;
    background: var(--tr-primary);
    border-bottom-color: rgba(255, 255, 255, .22);
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) td:first-child,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable):hover td:first-child,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable).is-selected td:first-child {
    box-shadow: inset 5px 0 0 var(--tr-primary-strong);
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) a,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-table-website,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-interest-control small {
    color: #fff;
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-interest-control small {
    opacity: .82;
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-inline-editor .tr-dropdown-button {
    color: #fff;
    border-color: rgba(255, 255, 255, .30);
    background: rgba(255, 255, 255, .15);
    box-shadow: none;
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-inline-editor .tr-dropdown-button:hover,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-inline-editor.is-open .tr-dropdown-button {
    border-color: rgba(255, 255, 255, .58);
    background: rgba(255, 255, 255, .22);
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-inline-editor .tr-dropdown-chevron {
    border-right-color: rgba(255, 255, 255, .9);
    border-bottom-color: rgba(255, 255, 255, .9);
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-interest-control input + .tr-interest-box,
.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-check-wrap input + span {
    border-color: rgba(255, 255, 255, .78);
    background: rgba(255, 255, 255, .08);
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-interest-control input:checked + .tr-interest-box {
    border-color: #fff;
    background: #fff;
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-interest-control input:checked + .tr-interest-box::after {
    border-left-color: var(--tr-primary);
    border-bottom-color: var(--tr-primary);
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-quick-delete {
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.tr-table--clients tbody tr:is(.is-high-interested, .is-suitable) .tr-quick-delete:hover {
    border-color: rgba(255, 255, 255, .72);
    color: #fff;
    background: rgba(255, 255, 255, .22);
}


.tr-table--clients tbody tr.is-unsuitable,
.tr-table--clients tbody tr.is-unsuitable:hover,
.tr-table--clients tbody tr.is-unsuitable.is-selected {
    background: var(--tr-danger);
}

.tr-table--clients tbody tr.is-unsuitable td,
.tr-table--clients tbody tr.is-unsuitable:hover td,
.tr-table--clients tbody tr.is-unsuitable.is-selected td,
.tr-table--clients tbody tr.is-unsuitable .tr-select-cell,
.tr-table--clients tbody tr.is-unsuitable:hover .tr-select-cell,
.tr-table--clients tbody tr.is-unsuitable.is-selected .tr-select-cell,
.tr-table--clients tbody tr.is-unsuitable .tr-delete-cell,
.tr-table--clients tbody tr.is-unsuitable:hover .tr-delete-cell,
.tr-table--clients tbody tr.is-unsuitable.is-selected .tr-delete-cell {
    color: #fff;
    background: var(--tr-danger);
    border-bottom-color: rgba(255, 255, 255, .22);
}

.tr-table--clients tbody tr.is-unsuitable td:first-child,
.tr-table--clients tbody tr.is-unsuitable:hover td:first-child,
.tr-table--clients tbody tr.is-unsuitable.is-selected td:first-child {
    box-shadow: inset 5px 0 0 #b83242;
}

.tr-table--clients tbody tr.is-unsuitable a,
.tr-table--clients tbody tr.is-unsuitable .tr-table-website,
.tr-table--clients tbody tr.is-unsuitable .tr-interest-control small {
    color: #fff;
}

.tr-table--clients tbody tr.is-unsuitable .tr-interest-control small {
    opacity: .82;
}

.tr-table--clients tbody tr.is-unsuitable .tr-inline-editor .tr-dropdown-button {
    color: #fff;
    border-color: rgba(255, 255, 255, .30);
    background: rgba(255, 255, 255, .15);
    box-shadow: none;
}

.tr-table--clients tbody tr.is-unsuitable .tr-inline-editor .tr-dropdown-button:hover,
.tr-table--clients tbody tr.is-unsuitable .tr-inline-editor.is-open .tr-dropdown-button {
    border-color: rgba(255, 255, 255, .58);
    background: rgba(255, 255, 255, .22);
}

.tr-table--clients tbody tr.is-unsuitable .tr-inline-editor .tr-dropdown-chevron {
    border-right-color: rgba(255, 255, 255, .9);
    border-bottom-color: rgba(255, 255, 255, .9);
}

.tr-table--clients tbody tr.is-unsuitable .tr-interest-control input + .tr-interest-box,
.tr-table--clients tbody tr.is-unsuitable .tr-check-wrap input + span {
    border-color: rgba(255, 255, 255, .78);
    background: rgba(255, 255, 255, .08);
}

.tr-table--clients tbody tr.is-unsuitable .tr-interest-control input:checked + .tr-interest-box {
    border-color: #fff;
    background: #fff;
}

.tr-table--clients tbody tr.is-unsuitable .tr-interest-control input:checked + .tr-interest-box::after {
    border-left-color: var(--tr-danger);
    border-bottom-color: var(--tr-danger);
}

.tr-table--clients tbody tr.is-unsuitable .tr-quick-delete {
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.tr-table--clients tbody tr.is-unsuitable .tr-quick-delete:hover {
    border-color: rgba(255, 255, 255, .72);
    color: #fff;
    background: rgba(255, 255, 255, .22);
}

.tr-interest-control--modal-high::after {
    content: 'Άμεσα ενδιαφερόμενος';
}

@media (max-width: 1180px) {
    .tr-filters--clients,
    .tr-filters--active {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tr-filters--clients .tr-search-wrap,
    .tr-filters--active .tr-search-wrap {
        grid-column: 1 / -1;
    }
}

@media (max-width: 980px) {
    .tr-table--clients-contacted {
        min-width: 1620px;
    }
}

@media (max-width: 720px) {
    .tr-filters--clients,
    .tr-filters--active {
        grid-template-columns: 1fr;
    }

    .tr-filters--clients .tr-search-wrap,
    .tr-filters--active .tr-search-wrap {
        grid-column: auto;
    }
}


/* Demo flag: Active clients only. */
.tr-table--clients-active .tr-demo-cell {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    text-align: center;
}



/* Client suitability/review flags: main Clients table only. */
.tr-table--clients .tr-suitable-cell {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

.tr-table--clients .tr-reviewed-cell {
    width: 125px;
    min-width: 125px;
    max-width: 125px;
    text-align: center;
}

.tr-interest-control--modal-reviewed::after {
    content: 'Τσεκαρίστηκε / Δεν τσεκαρίστηκε';
}

.tr-table--clients-contacted {
    min-width: 1910px;
}

/* Accepted ride email notification status */
.tr-email-state-cell {
    min-width: 150px;
}

.tr-email-state {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}

.tr-email-state--sent {
    color: #17343F;
    background: rgba(51, 255, 102, .24);
    border: 1px solid rgba(0, 255, 81, .48);
}

.tr-email-state--skipped {
    color: #657780;
    background: rgba(171, 188, 195, .16);
    border: 1px solid rgba(171, 188, 195, .46);
}

.tr-email-state--pending {
    color: var(--tr-text-soft);
    background: var(--tr-surface-soft);
    border: 1px solid var(--tr-border);
}

.tr-email-state--failed {
    color: var(--tr-danger);
    background: var(--tr-danger-soft);
    border: 1px solid rgba(217, 75, 91, .25);
}

.tr-email-state-time {
    display: block;
    max-width: 220px;
    margin-top: 5px;
    color: var(--tr-text-soft);
    font-size: 10px;
    line-height: 1.35;
    white-space: normal;
}

/* Tri-state client interest selector */
.tr-interest-select {
    min-width: 180px;
}

.tr-interest-select > small,
.tr-interest-modal-field > small {
    display: block;
    margin-top: 5px;
    color: var(--tr-text-soft);
    font-size: 9px;
    line-height: 1.35;
    white-space: normal;
}

.tr-inline-editor--interest {
    min-width: 165px;
}

.tr-inline-editor--interest .tr-dropdown-button {
    color: var(--tr-text);
    background: var(--tr-surface-soft);
}

.tr-inline-editor--interest .tr-dropdown-menu {
    min-width: 180px;
}

.tr-interest-modal-field #tr-client-dd-interested.is-saving,
.tr-inline-editor--interest.is-saving {
    opacity: .55;
    pointer-events: none;
}

/* Device heartbeat: four switchable metrics in one chart */
.tr-device-summary--metrics {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tr-device-clients-card {
    margin-top: var(--tr-space-xl);
}

.tr-device-clients-list {
    display: grid;
    gap: var(--tr-space-md);
    padding: var(--tr-space-lg) 18px 18px;
}

.tr-device-client-row {
    display: grid;
    grid-template-columns: minmax(190px, .85fr) minmax(240px, 1.4fr);
    gap: var(--tr-space-lg);
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--tr-border);
    border-radius: 12px;
    background: var(--tr-surface-soft);
}

.tr-device-client-main,
.tr-device-client-stage {
    min-width: 0;
    display: grid;
    gap: var(--tr-space-2xs);
}

.tr-device-client-main strong,
.tr-device-client-stage strong {
    color: var(--tr-text);
    font-size: var(--tr-font-md);
    line-height: var(--tr-line-base);
    overflow-wrap: anywhere;
}

.tr-device-client-main span,
.tr-device-client-stage small,
.tr-device-client-stage-label {
    color: var(--tr-text-soft);
    font-size: var(--tr-font-xs);
    line-height: var(--tr-line-base);
}

.tr-device-client-stage-label {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.tr-chart-header--switches {
    align-items: center;
}

.tr-metric-switches {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.tr-metric-switch {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--tr-border);
    border-radius: 999px;
    color: var(--tr-text-soft);
    background: #fff;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color var(--tr-transition), color var(--tr-transition), background var(--tr-transition), box-shadow var(--tr-transition), opacity var(--tr-transition);
}

.tr-metric-switch i {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--metric-color, var(--tr-primary));
    opacity: .28;
    transition: opacity var(--tr-transition), transform var(--tr-transition);
}

.tr-metric-switch:hover,
.tr-metric-switch.is-active {
    color: var(--tr-text);
    border-color: color-mix(in srgb, var(--metric-color, var(--tr-primary)) 35%, var(--tr-border));
    background: color-mix(in srgb, var(--metric-color, var(--tr-primary)) 7%, #fff);
    box-shadow: 0 5px 15px rgba(32, 56, 104, .07);
}

.tr-metric-switch.is-active i {
    opacity: 1;
    transform: scale(1.08);
}

.tr-metric-switch:not(.is-active) {
    opacity: .62;
}

/* Ride logs */
.tr-toolbar--ride-logs {
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
}

.tr-toolbar--cloudflare-logs {
    grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.35fr) minmax(280px, 1fr);
}

.tr-cloudflare-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: -2px 0 16px;
}

.tr-table--cloudflare-logs {
    width: 1700px;
    min-width: 1700px;
    table-layout: fixed;
}

.tr-table--cloudflare-logs th,
.tr-table--cloudflare-logs td {
    min-width: 0;
    overflow: hidden;
}

.tr-table--cloudflare-logs th:nth-child(1),
.tr-table--cloudflare-logs td:nth-child(1) { width: 165px; }
.tr-table--cloudflare-logs th:nth-child(2),
.tr-table--cloudflare-logs td:nth-child(2) { width: 185px; }
.tr-table--cloudflare-logs th:nth-child(3),
.tr-table--cloudflare-logs td:nth-child(3) { width: 245px; }
.tr-table--cloudflare-logs th:nth-child(4),
.tr-table--cloudflare-logs td:nth-child(4) { width: 175px; }
.tr-table--cloudflare-logs th:nth-child(5),
.tr-table--cloudflare-logs td:nth-child(5) { width: 120px; }
.tr-table--cloudflare-logs th:nth-child(6),
.tr-table--cloudflare-logs td:nth-child(6) { width: 95px; }
.tr-table--cloudflare-logs th:nth-child(7),
.tr-table--cloudflare-logs td:nth-child(7) { width: 125px; }
.tr-table--cloudflare-logs th:nth-child(8),
.tr-table--cloudflare-logs td:nth-child(8) { width: 95px; }
.tr-table--cloudflare-logs th:nth-child(9),
.tr-table--cloudflare-logs td:nth-child(9) { width: 185px; }
.tr-table--cloudflare-logs th:nth-child(10),
.tr-table--cloudflare-logs td:nth-child(10) { width: 225px; }

.tr-table--cloudflare-logs td:nth-child(2),
.tr-table--cloudflare-logs td:nth-child(5),
.tr-table--cloudflare-logs td:nth-child(6),
.tr-table--cloudflare-logs td:nth-child(7),
.tr-table--cloudflare-logs td:nth-child(8),
.tr-table--cloudflare-logs td:nth-child(9) {
    white-space: nowrap;
}

.tr-table--cloudflare-logs td:nth-child(3),
.tr-table--cloudflare-logs td:nth-child(10) {
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-ride-log-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tr-table--ride-logs {
    width: 1620px;
    min-width: 1620px;
    table-layout: fixed;
}

.tr-table--ride-logs th,
.tr-table--ride-logs td {
    min-width: 0;
    overflow: hidden;
}

.tr-table--ride-logs th:nth-child(1),
.tr-table--ride-logs td:nth-child(1) { width: 90px; }
.tr-table--ride-logs th:nth-child(2),
.tr-table--ride-logs td:nth-child(2) { width: 95px; }
.tr-table--ride-logs th:nth-child(3),
.tr-table--ride-logs td:nth-child(3) { width: 220px; }
.tr-table--ride-logs th:nth-child(4),
.tr-table--ride-logs td:nth-child(4) { width: 160px; }
.tr-table--ride-logs th:nth-child(5),
.tr-table--ride-logs td:nth-child(5) { width: 220px; }
.tr-table--ride-logs th:nth-child(6),
.tr-table--ride-logs td:nth-child(6) { width: 105px; }
.tr-table--ride-logs th:nth-child(7),
.tr-table--ride-logs td:nth-child(7) { width: 260px; }
.tr-table--ride-logs th:nth-child(8),
.tr-table--ride-logs td:nth-child(8) { width: 90px; }
.tr-table--ride-logs th:nth-child(9),
.tr-table--ride-logs td:nth-child(9) { width: 160px; }
.tr-table--ride-logs th:nth-child(10),
.tr-table--ride-logs td:nth-child(10) { width: 220px; }

.tr-table--ride-logs td:nth-child(4),
.tr-table--ride-logs td:nth-child(6),
.tr-table--ride-logs td:nth-child(8),
.tr-table--ride-logs td:nth-child(9) {
    white-space: nowrap;
}

.tr-table--ride-logs td:nth-child(5),
.tr-table--ride-logs td:nth-child(10) {
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-table--ride-logs .tr-log-sources {
    width: 100%;
    min-width: 0;
    white-space: normal;
}

.tr-log-source {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin: 2px 4px 2px 0;
    padding: 0 9px;
    border: 1px solid var(--tr-border);
    border-radius: 999px;
    color: var(--tr-text-soft);
    background: var(--tr-surface-soft);
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.tr-log-source--network {
    color: #1f58e8;
    border-color: rgba(38, 103, 255, .20);
    background: rgba(38, 103, 255, .08);
}

.tr-log-source--card {
    color: #14784a;
    border-color: rgba(25, 166, 106, .20);
    background: rgba(25, 166, 106, .08);
}

.tr-log-source--details {
    color: #9b6500;
    border-color: rgba(227, 154, 39, .24);
    background: rgba(227, 154, 39, .10);
}

.tr-log-source--gui {
    color: #6a39b8;
    border-color: rgba(106, 57, 184, .22);
    background: rgba(106, 57, 184, .09);
}

.tr-ride-log-conclusion {
    width: auto;
    max-width: none;
    overflow: hidden;
    color: var(--tr-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-log-stages-compact {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.tr-log-stage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid var(--tr-border);
    border-radius: 999px;
    color: var(--tr-text-soft);
    background: var(--tr-surface-soft);
    font-size: var(--tr-pill-size);
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.tr-log-stage--accepted,
.tr-log-stage--success {
    color: var(--tr-success);
    border-color: rgba(25, 166, 106, .22);
    background: var(--tr-success-soft);
}

.tr-log-stage--failed,
.tr-log-stage--lost {
    color: var(--tr-danger);
    border-color: rgba(203, 63, 83, .20);
    background: var(--tr-danger-soft);
}

.tr-log-stage--in_progress,
.tr-log-stage--detected {
    color: var(--tr-primary);
    border-color: rgba(38, 103, 255, .20);
    background: rgba(38, 103, 255, .08);
}

.tr-log-stage-empty {
    color: var(--tr-text-soft);
}

.tr-ride-log-modal-result {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--tr-border);
}

.tr-ride-log-modal-result .tr-badge {
    justify-self: start;
}

.tr-ride-log-modal-result > strong {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.tr-ride-log-history-section {
    padding: 14px;
    border: 1px solid var(--tr-border);
    border-radius: 14px;
    background: #fff;
}

.tr-ride-log-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tr-ride-log-section-head h3 {
    margin: 0;
    font-size: 13px;
}

.tr-ride-log-section-head span {
    color: var(--tr-text-soft);
    font-size: 10px;
    font-weight: 700;
}

.tr-ride-log-timeline {
    display: grid;
    gap: 8px;
}

.tr-ride-log-timeline-empty {
    padding: 14px;
    border-radius: 10px;
    color: var(--tr-text-soft);
    background: var(--tr-surface-soft);
    font-size: 11px;
    text-align: center;
}

.tr-ride-log-step {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--tr-border);
    border-radius: 11px;
    background: var(--tr-surface-soft);
}

.tr-ride-log-step-index {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: var(--tr-primary);
    background: rgba(38, 103, 255, .10);
    font-size: 10px;
    font-weight: 850;
}

.tr-ride-log-step--accepted .tr-ride-log-step-index,
.tr-ride-log-step--success .tr-ride-log-step-index {
    color: var(--tr-success);
    background: var(--tr-success-soft);
}

.tr-ride-log-step--failed .tr-ride-log-step-index,
.tr-ride-log-step--lost .tr-ride-log-step-index {
    color: var(--tr-danger);
    background: var(--tr-danger-soft);
}

.tr-ride-log-step-body {
    min-width: 0;
}

.tr-ride-log-step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tr-ride-log-step-head strong {
    min-width: 0;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.tr-ride-log-step-head span,
.tr-ride-log-step-body time,
.tr-ride-log-step-body small {
    color: var(--tr-text-soft);
    font-size: 9px;
    font-weight: 700;
}

.tr-ride-log-step-body time {
    display: block;
    margin-top: 3px;
}

.tr-ride-log-step-body p {
    margin: 7px 0 0;
    font-size: 10px;
    line-height: 1.45;
}

.tr-ride-log-step-body small {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.tr-ride-log-step-warning {
    color: var(--tr-warning) !important;
}

.tr-device-manager-meta > span {
    display: inline-flex;
    align-items: center;
}

.tr-summary-card .tr-badge,
.tr-device-manager-meta .tr-badge {
    align-items: center;
    justify-content: center;
}

@media (max-width: 1180px) {
    .tr-device-summary--metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .tr-toolbar--devices { grid-template-columns: 1fr; max-width: none; }
    .tr-device-selection-meta--spacer { display: none; }
    .tr-working-hours-grid { grid-template-columns: 1fr; }

    .tr-device-summary--metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tr-chart-header--switches {
        align-items: flex-start;
        flex-direction: column;
    }

    .tr-metric-switches {
        justify-content: flex-start;
    }

    .tr-toolbar--ride-logs,
    .tr-toolbar--cloudflare-logs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .tr-device-summary--metrics,
    .tr-ride-log-summary {
        grid-template-columns: 1fr;
    }

    .tr-cloudflare-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tr-cloudflare-actions .tr-button {
        width: 100%;
    }

    .tr-editor-section-head--with-action {
        flex-wrap: wrap;
    }

    .tr-editor-section-head--with-action .tr-button {
        width: 100%;
        margin-left: 0;
    }

    .tr-metric-switches {
        width: 100%;
    }

    .tr-metric-switch {
        flex: 1 1 calc(50% - 7px);
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tr-metric-switch {
        flex-basis: 100%;
    }
}

/* Mobile modal ergonomics + ride-log drill-down */
.tr-ride-log-row {
    cursor: pointer;
}

.tr-ride-log-row:hover td {
    background: rgba(38, 103, 255, .035);
}

.tr-ride-log-row:focus-visible {
    outline: 2px solid rgba(38, 103, 255, .65);
    outline-offset: -2px;
}

.tr-log-sources-compact {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    width: 160px;
    max-width: 160px;
    height: 30px;
    overflow: hidden;
}

.tr-log-sources-compact .tr-log-source {
    flex: 0 0 auto;
    margin: 2px 0;
}

.tr-modal--ride-log {
    width: min(760px, 100%);
    max-height: min(760px, calc(100dvh - 48px));
}

.tr-modal--ride-log .tr-modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.tr-ride-log-modal-content {
    display: grid;
    gap: 16px;
}

.tr-ride-log-modal-lead {
    padding: 16px;
    border: 1px solid var(--tr-border);
    border-radius: 14px;
    background: var(--tr-surface-soft);
}

.tr-ride-log-modal-lead > span,
.tr-ride-log-detail > span {
    display: block;
    margin-bottom: 5px;
    color: var(--tr-text-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.tr-ride-log-modal-lead > strong {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.tr-log-sources--modal {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tr-ride-log-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tr-ride-log-detail {
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid var(--tr-border);
    border-radius: 12px;
    background: #fff;
}

.tr-ride-log-detail--full {
    grid-column: 1 / -1;
}

.tr-ride-log-detail strong,
.tr-ride-log-detail a {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--tr-text);
    font-size: 11px;
    line-height: 1.45;
}

.tr-ride-log-detail a {
    color: var(--tr-primary);
}

@media (max-width: 720px) {
    .tr-modal-backdrop {
        padding: 20px 12px;
    }

    .tr-modal {
        width: min(100%, 620px);
        max-height: min(82dvh, 720px);
        border-radius: 16px;
    }

    .tr-modal-header {
        gap: 10px;
        padding: 14px 16px;
    }

    .tr-modal-header h2 {
        font-size: 14px;
        line-height: 1.25;
    }

    .tr-modal-body {
        padding: 14px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .tr-modal .tr-client-editor-form {
        gap: 14px;
    }

    .tr-modal .tr-editor-section,
    .tr-modal .tr-credentials-panel {
        padding: 14px;
    }

    .tr-modal .tr-field input,
    .tr-modal .tr-control,
    .tr-modal .tr-dropdown-button,
    .tr-modal .tr-date-range-button {
        min-height: 42px;
        font-size: 12px;
    }

    .tr-modal .tr-field textarea {
        min-height: 88px;
        font-size: 12px;
    }

    .tr-modal .tr-button {
        min-height: 40px;
        padding: 8px 11px;
        font-size: 11px;
        line-height: 1.2;
    }

    .tr-editor-actions {
        bottom: -14px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 0 -14px -14px;
        padding: 14px;
        background: linear-gradient(180deg, rgba(255,255,255,0), #fff 24%);
    }

    .tr-editor-actions > span:first-child {
        display: none;
    }

    .tr-editor-actions > span:first-child + .tr-button {
        grid-column: 1 / -1;
    }

    .tr-editor-actions .tr-button {
        width: 100%;
        white-space: normal;
    }

    .tr-delete-confirm-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .tr-delete-confirm-actions .tr-button,
    .tr-credentials-panel .tr-button {
        width: 100%;
        font-size: 11px;
    }

    .tr-modal--ride-log {
        max-height: min(82dvh, 680px);
    }

    .tr-ride-log-detail-grid {
        grid-template-columns: 1fr;
    }

    .tr-ride-log-detail--full {
        grid-column: auto;
    }

    .tr-ride-log-section-head,
    .tr-ride-log-step-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .tr-ride-log-history-section {
        padding: 12px;
    }

    .tr-ride-log-step {
        grid-template-columns: 26px minmax(0, 1fr);
        gap: 8px;
        padding: 9px;
    }

    .tr-ride-log-step-index {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 480px) {
    .tr-modal-backdrop {
        padding: 18px 10px;
    }

    .tr-modal {
        max-height: 80dvh;
        border-radius: 14px;
    }

    .tr-modal-header {
        padding: 12px 14px;
    }

    .tr-modal-body {
        padding: 12px;
    }

    .tr-modal .tr-editor-section,
    .tr-modal .tr-credentials-panel {
        padding: 12px;
    }

    .tr-editor-actions {
        bottom: -12px;
        gap: 8px;
        margin: 0 -12px -12px;
        padding: 12px;
    }

    .tr-modal .tr-button {
        min-height: 38px;
        padding: 7px 9px;
        font-size: 10.5px;
    }

    .tr-modal-close {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .tr-log-sources-compact {
        width: 150px;
        max-width: 150px;
    }
}

@media (max-width: 720px) {
    .tr-device-client-row { grid-template-columns: 1fr; gap: var(--tr-space-sm); }
    .tr-policy-settings-form,
    .tr-closed-period-form { grid-template-columns: 1fr; }
    .tr-working-hours-row { grid-template-columns: 1fr 1fr; }
    .tr-working-hours-row .tr-policy-check { grid-column: 1 / -1; }
    .tr-closed-period-form-actions { grid-column: auto; }
    .tr-closed-period-row { align-items: flex-start; flex-direction: column; }
    .tr-closed-period-pagination { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
    .tr-modal .tr-acceptance-policy-panel { padding: 12px; }
    .tr-working-hours-row { grid-template-columns: 1fr; }
    .tr-working-hours-row .tr-policy-check { grid-column: auto; }
    .tr-closed-period-actions,
    .tr-closed-period-form-actions { width: 100%; flex-direction: column; }
    .tr-closed-period-actions .tr-button,
    .tr-closed-period-form-actions .tr-button { width: 100%; }
}
