
:root {
    /* Brand */
    --tr-navy: #000f47;
    --tr-navy-700: #071a5e;
    --tr-navy-600: #14276f;
    --tr-navy-400: #4a5893;
    --tr-red: #d60b28;
    --tr-red-600: #b70a22;
    /* Semantic */
    --tr-success: #1e9e4a;
    --tr-success-bg: #eaf6ee;
    --tr-warning: #e08a0b;
    --tr-warning-bg: #fdf3e3;
    --tr-danger: #d60b28;
    --tr-danger-bg: #fceaec;
    --tr-info: #0b77c2;
    --tr-info-bg: #e8f2fb;
    /* Neutrals */
    --tr-body-bg: #f4f5f8;
    --tr-card-bg: #ffffff;
    --tr-border: #e3e5ec;
    --tr-border-strong: #d2d6e0;
    --tr-text: #2b2f3a;
    --tr-text-muted: #7c8194;
    --tr-heading: #1b1f2b;
    /* Metrics */
    --tr-navbar-h: 52px;
    --tr-sidebar-w: 260px;
    --tr-radius: 4px;
    --tr-radius-sm: 3px;
    --tr-shadow-card: 0 1px 2px rgba(16, 24, 64, .06), 0 1px 3px rgba(16, 24, 64, .05);
    --tr-shadow-raised: 0 2px 6px rgba(16, 24, 64, .09), 0 8px 24px rgba(16, 24, 64, .06);
    --tr-shadow-navbar: 0 1px 3px rgba(0, 15, 71, .18);
    --tr-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
}

body.tr-body {
    font-family: var(--tr-font);
    font-size: .8125rem;
    line-height: 1.5385;
    color: var(--tr-text);
    background-color: var(--tr-body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100%;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--tr-heading);
    font-weight: 600;
    letter-spacing: -.01em;
}

h1, .h1 {
    font-size: 1.5rem;
}

h2, .h2 {
    font-size: 1.3125rem;
}

h3, .h3 {
    font-size: 1.125rem;
}

h4, .h4 {
    font-size: 1rem;
}

h5, .h5 {
    font-size: .9375rem;
}

h6, .h6 {
    font-size: .8125rem;
}

a {
    color: var(--tr-navy-600);
    text-decoration: none;
}

    a:hover {
        color: var(--tr-red);
    }

.text-muted {
    color: var(--tr-text-muted) !important;
}

.fs-sm {
    font-size: .75rem !important;
}

.fs-xs {
    font-size: .6875rem !important;
}

.fs-base {
    font-size: .8125rem !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.tr-mono {
    font-family: "Cascadia Mono", Consolas, "SF Mono", "Roboto Mono", monospace;
}

.tr-tracking {
    letter-spacing: .06em;
}

hr {
    border-color: var(--tr-border);
    opacity: 1;
}

::selection {
    background: rgba(0, 15, 71, .12);
}

/* Focus ring — consistent, accessible, non-glowy */
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
a:focus-visible,
button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 15, 71, .14);
    border-color: var(--tr-navy-400);
}

/* Scrollbars */
.tr-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
}

    .tr-scroll::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .tr-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .tr-scroll::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .2);
        border-radius: 3px;
    }

        .tr-scroll::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, .32);
        }

.tr-scroll-light {
    scrollbar-width: thin;
    scrollbar-color: var(--tr-border-strong) transparent;
}

    .tr-scroll-light::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .tr-scroll-light::-webkit-scrollbar-thumb {
        background: var(--tr-border-strong);
        border-radius: 3px;
    }

/* --------------------------------------------------------------------------
   3. Top navbar
   -------------------------------------------------------------------------- */
.tr-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--tr-navbar-h);
    z-index: 1035;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--tr-navy);
    box-shadow: var(--tr-shadow-navbar);
    color: rgba(255, 255, 255, .85);
}

    .tr-navbar .tr-brand,
    .tr-chooser-bar .tr-brand {
        display: inline-flex;
        align-items: center;
        gap: .625rem;
        color: #fff;
        min-width: 0;
    }

        .tr-navbar .tr-brand:hover,
        .tr-chooser-bar .tr-brand:hover {
            color: #fff;
        }

.tr-brand-mark {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: var(--tr-radius-sm);
    background: linear-gradient(140deg, var(--tr-red) 0%, #ff3d55 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 1px 3px rgba(214, 11, 40, .5);
}

.tr-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.tr-brand-name {
    font-size: .9375rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.tr-brand-sub {
    font-size: .625rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .55);
}

/* Navbar action buttons */
.tr-nav-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 .5rem;
    border: 0;
    border-radius: var(--tr-radius);
    background: transparent;
    color: rgba(255, 255, 255, .78);
    font-size: .9375rem;
    transition: background-color .15s ease, color .15s ease;
}

    .tr-nav-btn:hover,
    .tr-nav-btn.show {
        background: rgba(255, 255, 255, .12);
        color: #fff;
    }

    .tr-nav-btn::after {
        display: none;
    }

.tr-nav-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tr-red);
    box-shadow: 0 0 0 2px var(--tr-navy);
}

/* Current-event chip in the navbar */
.tr-nav-event {
    display: none;
    align-items: center;
    gap: .5rem;
    max-width: 320px;
    padding: .25rem .625rem;
    border-radius: var(--tr-radius);
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .9);
    border: 1px solid rgba(255, 255, 255, .1);
}

    .tr-nav-event:hover {
        background: rgba(255, 255, 255, .14);
        color: #fff;
    }

    .tr-nav-event .tr-nav-event-label {
        font-size: .625rem;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: rgba(255, 255, 255, .55);
    }

    .tr-nav-event .tr-nav-event-name {
        font-size: .75rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

@media (min-width: 992px) {
    .tr-nav-event {
        display: inline-flex;
    }
}

@media (min-width: 992px) {
    .tr-nav-event1 {
        display: inline-flex;
    }
}

/* Navbar user */
.tr-nav-user {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    height: 34px;
    padding: 0 .5rem;
    border-radius: var(--tr-radius);
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, .85);
    transition: background-color .15s ease;
}

    .tr-nav-user:hover, .tr-nav-user.show {
        background: rgba(255, 255, 255, .12);
        color: #fff;
    }

    .tr-nav-user::after {
        display: none;
    }

    .tr-nav-user .tr-nav-user-meta {
        display: none;
        text-align: left;
        line-height: 1.15;
    }

    .tr-nav-user .tr-nav-user-name {
        font-size: .75rem;
        font-weight: 600;
    }

    .tr-nav-user .tr-nav-user-role {
        font-size: .625rem;
        color: rgba(255, 255, 255, .55);
    }

@media (min-width: 768px) {
    .tr-nav-user .tr-nav-user-meta {
        display: block;
    }
}

.tr-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .02em;
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.tr-avatar-lg {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: .9375rem;
}

.tr-avatar-xl {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    font-size: 1.5rem;
}

.tr-avatar-navy {
    background: var(--tr-navy);
    color: #fff;
}

.tr-avatar-soft {
    background: rgba(0, 15, 71, .08);
    color: var(--tr-navy);
}

/* --------------------------------------------------------------------------
   4. Shell layout
   -------------------------------------------------------------------------- */
.tr-shell {
    display: flex;
    align-items: stretch;
    padding-top: var(--tr-navbar-h);
    min-height: 100vh;
}

.tr-content-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tr-content-inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.tr-content {
    flex: 1 1 auto;
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .tr-content {
        padding: 1.25rem 1.5rem;
    }
}

.tr-footer {
    padding: .875rem 1.25rem;
    border-top: 1px solid var(--tr-border);
    color: var(--tr-text-muted);
    font-size: .75rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .tr-footer {
        padding: .875rem 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   5. Sidebar
   -------------------------------------------------------------------------- */
.tr-sidebar {
    position: fixed;
    top: var(--tr-navbar-h);
    bottom: 0;
    left: 0;
    width: var(--tr-sidebar-w);
    z-index: 1030;
    background: var(--tr-navy);
    color: rgba(255, 255, 255, .72);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .2s ease, width .2s ease;
}

.tr-shell.tr-sidebar-open .tr-sidebar {
    transform: translateX(0);
}

.tr-sidebar-backdrop {
    position: fixed;
    inset: var(--tr-navbar-h) 0 0 0;
    background: rgba(11, 16, 38, .5);
    z-index: 1029;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.tr-shell.tr-sidebar-open .tr-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 992px) {
    .tr-sidebar {
        transform: translateX(0);
    }

    .tr-content-wrapper {
        margin-left: var(--tr-sidebar-w);
    }

    .tr-sidebar-backdrop {
        display: none;
    }

    /* Desktop collapse ("mini" sidebar) */
    .tr-shell.tr-sidebar-collapsed {
        --tr-sidebar-w: 58px;
    }

        .tr-shell.tr-sidebar-collapsed .tr-sidebar-hide {
            display: none;
        }

        .tr-shell.tr-sidebar-collapsed .tr-nav-sidebar .tr-nav-link {
            justify-content: center;
            padding-left: 0;
            padding-right: 0;
        }

            .tr-shell.tr-sidebar-collapsed .tr-nav-sidebar .tr-nav-link > i {
                margin-right: 0;
            }

        .tr-shell.tr-sidebar-collapsed .tr-sidebar-heading {
            text-align: center;
            padding-left: 0;
            padding-right: 0;
        }

        .tr-shell.tr-sidebar-collapsed .tr-sidebar-event {
            display: none;
        }
}

.tr-sidebar-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.tr-sidebar-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    height: 44px;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    flex: 0 0 auto;
}

.tr-sidebar-head-title {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .45);
    font-weight: 600;
}

.tr-sidebar-ctl {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--tr-radius-sm);
    background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .7);
    font-size: .8125rem;
    transition: background-color .15s ease, color .15s ease;
}

    .tr-sidebar-ctl:hover {
        background: rgba(255, 255, 255, .16);
        color: #fff;
    }

/* Selected-event card inside sidebar */
.tr-sidebar-event {
    display: block;
    margin: .875rem .75rem .5rem;
    padding: .75rem;
    border-radius: var(--tr-radius);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
}

.tr-sidebar-event-label {
    font-size: .625rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(255, 255, 255, .45);
    margin-bottom: .25rem;
}

.tr-sidebar-event-name {
    color: #fff;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.3;
}

.tr-sidebar-event-meta {
    font-size: .6875rem;
    color: rgba(255, 255, 255, .55);
    margin-top: .1875rem;
}

.tr-sidebar-event-progress {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .14);
    overflow: hidden;
    margin-top: .5rem;
}

    .tr-sidebar-event-progress > span {
        display: block;
        height: 100%;
        background: var(--tr-success);
        border-radius: 2px;
    }

/* Sidebar nav */
.tr-sidebar-heading {
    padding: 1rem 1rem .375rem;
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .11em;
    color: rgba(255, 255, 255, .38);
}

.tr-nav-sidebar {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .tr-nav-sidebar .tr-nav-link {
        display: flex;
        align-items: center;
        padding: .5625rem 1rem;
        color: rgba(255, 255, 255, .72);
        font-size: .8125rem;
        border-left: 2px solid transparent;
        transition: background-color .12s ease, color .12s ease;
    }

        .tr-nav-sidebar .tr-nav-link > i {
            font-size: 1rem;
            width: 20px;
            margin-right: .75rem;
            flex: 0 0 20px;
            text-align: center;
            opacity: .85;
        }

        .tr-nav-sidebar .tr-nav-link:hover {
            background: rgba(255, 255, 255, .07);
            color: #fff;
        }

        .tr-nav-sidebar .tr-nav-link.active {
            background: rgba(255, 255, 255, .1);
            border-left-color: var(--tr-red);
            color: #fff;
            font-weight: 600;
        }

            .tr-nav-sidebar .tr-nav-link.active > i {
                opacity: 1;
                color: #fff;
            }

    .tr-nav-sidebar .tr-nav-badge {
        margin-left: auto;
        font-size: .625rem;
        font-weight: 700;
        padding: .1875rem .375rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, .16);
        color: #fff;
        line-height: 1;
    }

        .tr-nav-sidebar .tr-nav-badge.tr-nav-badge-accent {
            background: var(--tr-red);
        }

.tr-shell.tr-sidebar-collapsed .tr-nav-sidebar .tr-nav-badge {
    display: none;
}

/* --------------------------------------------------------------------------
   6. Page header + breadcrumbs
   -------------------------------------------------------------------------- */
.tr-page-header {
    background: #fff;
    border-bottom: 1px solid var(--tr-border);
    box-shadow: 0 1px 2px rgba(16, 24, 64, .04);
}

.tr-breadcrumb-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .5rem 1.25rem;
    border-bottom: 1px solid var(--tr-border);
    background: #fcfcfd;
}

@media (min-width: 768px) {
    .tr-breadcrumb-bar {
        padding: .5rem 1.5rem;
    }
}

.tr-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .75rem;
}

    .tr-breadcrumb li {
        display: flex;
        align-items: center;
        color: var(--tr-text-muted);
    }

        .tr-breadcrumb li + li::before {
            content: "\F285"; /* bi chevron-right */
            font-family: bootstrap-icons;
            font-size: .625rem;
            margin: 0 .5rem;
            color: var(--tr-border-strong);
        }

    .tr-breadcrumb a {
        color: var(--tr-text-muted);
        display: inline-flex;
        align-items: center;
        gap: .3125rem;
    }

        .tr-breadcrumb a:hover {
            color: var(--tr-navy);
        }

    .tr-breadcrumb li[aria-current="page"] {
        color: var(--tr-text);
        font-weight: 600;
    }

.tr-page-header-content {
    padding: .875rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .tr-page-header-content {
        padding: 1rem 1.5rem;
    }
}

.tr-page-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

    .tr-page-title .tr-page-title-light {
        font-weight: 400;
        color: var(--tr-text-muted);
    }

.tr-page-subtitle {
    font-size: .75rem;
    color: var(--tr-text-muted);
    margin: .1875rem 0 0;
}

.tr-page-header-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

/* Meta strip (event date / venue / gate) */
.tr-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem 1.25rem;
    padding: .625rem 1.25rem;
    border-top: 1px solid var(--tr-border);
    background: #fcfcfd;
    font-size: .75rem;
}

@media (min-width: 768px) {
    .tr-meta-strip {
        padding: .625rem 1.5rem;
    }
}

.tr-meta-item {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    color: var(--tr-text-muted);
}

    .tr-meta-item > i {
        font-size: .875rem;
        color: var(--tr-navy-400);
    }

    .tr-meta-item strong {
        color: var(--tr-text);
        font-weight: 600;
    }

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.tr-card {
    background: var(--tr-card-bg);
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow-card);
    margin-bottom: 1.25rem;
}

.tr-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .8125rem 1.125rem;
    border-bottom: 1px solid var(--tr-border);
}

    .tr-card-header h5, .tr-card-header h6 {
        margin: 0;
        font-size: .875rem;
        font-weight: 600;
    }

    .tr-card-header .tr-card-header-actions {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: .375rem;
        flex-wrap: wrap;
    }

.tr-card-body {
    padding: 1.125rem;
}

.tr-card-body-tight {
    padding: .875rem 1.125rem;
}

.tr-card-footer {
    padding: .8125rem 1.125rem;
    border-top: 1px solid var(--tr-border);
    background: #fcfcfd;
    border-radius: 0 0 var(--tr-radius) var(--tr-radius);
}

.tr-card-flush > .tr-card-body {
    padding: 0;
}

/* --------------------------------------------------------------------------
   8. Statistic widgets
   -------------------------------------------------------------------------- */
.tr-stat {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: 1.125rem;
    background: #fff;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow-card);
    height: 100%;
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

    .tr-stat::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--tr-stat-accent, var(--tr-navy));
    }

    .tr-stat:hover {
        box-shadow: var(--tr-shadow-raised);
    }

.tr-stat-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--tr-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    background: var(--tr-stat-bg, rgba(0, 15, 71, .07));
    color: var(--tr-stat-accent, var(--tr-navy));
}

.tr-stat-body {
    min-width: 0;
    flex: 1 1 auto;
}

.tr-stat-label {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 600;
    color: var(--tr-text-muted);
    margin-bottom: .25rem;
}

.tr-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--tr-heading);
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.tr-stat-caption {
    font-size: .6875rem;
    color: var(--tr-text-muted);
    margin-top: .3125rem;
    display: flex;
    align-items: center;
    gap: .25rem;
}

.tr-stat-navy {
    --tr-stat-accent: var(--tr-navy);
    --tr-stat-bg: rgba(0, 15, 71, .07);
}

.tr-stat-success {
    --tr-stat-accent: var(--tr-success);
    --tr-stat-bg: var(--tr-success-bg);
}

.tr-stat-warning {
    --tr-stat-accent: var(--tr-warning);
    --tr-stat-bg: var(--tr-warning-bg);
}

.tr-stat-danger {
    --tr-stat-accent: var(--tr-danger);
    --tr-stat-bg: var(--tr-danger-bg);
}

.tr-stat-info {
    --tr-stat-accent: var(--tr-info);
    --tr-stat-bg: var(--tr-info-bg);
}

/* Trend pill */
.tr-trend {
    display: inline-flex;
    align-items: center;
    gap: .1875rem;
    font-weight: 600;
}

.tr-trend-up {
    color: var(--tr-success);
}

.tr-trend-down {
    color: var(--tr-danger);
}

/* --------------------------------------------------------------------------
   9. Buttons
   -------------------------------------------------------------------------- */
.tr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4375rem;
    padding: .4375rem .875rem;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.3846;
    border-radius: var(--tr-radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--tr-text);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

    .tr-btn:disabled, .tr-btn.disabled {
        opacity: .55;
        pointer-events: none;
    }

    .tr-btn > i {
        font-size: .9375rem;
        line-height: 1;
    }

.tr-btn-sm {
    padding: .3125rem .625rem;
    font-size: .75rem;
}

.tr-btn-lg {
    padding: .625rem 1.25rem;
    font-size: .875rem;
}

.tr-btn-icon {
    padding: .4375rem;
    min-width: 32px;
}

    .tr-btn-icon.tr-btn-sm {
        padding: .3125rem;
        min-width: 28px;
    }

.tr-btn-block {
    width: 100%;
}

.tr-btn-primary {
    background: var(--tr-navy);
    border-color: var(--tr-navy);
    color: #fff;
}

    .tr-btn-primary:hover {
        background: var(--tr-navy-600);
        border-color: var(--tr-navy-600);
        color: #fff;
    }

.tr-btn-accent {
    background: var(--tr-red);
    border-color: var(--tr-red);
    color: #fff;
}

    .tr-btn-accent:hover {
        background: var(--tr-red-600);
        border-color: var(--tr-red-600);
        color: #fff;
    }

.tr-btn-success {
    background: var(--tr-success);
    border-color: var(--tr-success);
    color: #fff;
}

    .tr-btn-success:hover {
        background: #187f3b;
        border-color: #187f3b;
        color: #fff;
    }

.tr-btn-warning {
    background: var(--tr-warning);
    border-color: var(--tr-warning);
    color: #fff;
}

    .tr-btn-warning:hover {
        background: #c67908;
        color: #fff;
    }

.tr-btn-danger {
    background: var(--tr-danger);
    border-color: var(--tr-danger);
    color: #fff;
}

    .tr-btn-danger:hover {
        background: var(--tr-red-600);
        color: #fff;
    }

.tr-btn-light {
    background: #fff;
    border-color: var(--tr-border-strong);
    color: var(--tr-text);
}

    .tr-btn-light:hover {
        background: #f6f7fa;
        border-color: var(--tr-border-strong);
        color: var(--tr-navy);
    }

.tr-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--tr-text-muted);
}

    .tr-btn-ghost:hover {
        background: rgba(0, 15, 71, .06);
        color: var(--tr-navy);
    }

.tr-btn-outline-primary {
    background: transparent;
    border-color: var(--tr-navy);
    color: var(--tr-navy);
}

    .tr-btn-outline-primary:hover {
        background: var(--tr-navy);
        color: #fff;
    }

.tr-btn-outline-light {
    background: transparent;
    border-color: rgba(255, 255, 255, .35);
    color: #fff;
}

    .tr-btn-outline-light:hover {
        background: rgba(255, 255, 255, .14);
        color: #fff;
    }

/* Button loading state */
.tr-btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

    .tr-btn.is-loading > * {
        visibility: hidden;
    }

    .tr-btn.is-loading::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 14px;
        height: 14px;
        margin: -7px 0 0 -7px;
        border: 2px solid currentColor;
        border-top-color: transparent;
        border-radius: 50%;
        color: #fff;
        animation: tr-spin .6s linear infinite;
        visibility: visible;
    }

.tr-btn-light.is-loading::after, .tr-btn-ghost.is-loading::after, .tr-btn-outline-primary.is-loading::after {
    color: var(--tr-navy);
}

@keyframes tr-spin {
    to {
        transform: rotate(360deg);
    }
}

/* The hero SCAN action */
.tr-scan-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.125rem 1.25rem;
    border: 0;
    border-radius: var(--tr-radius);
    background: linear-gradient(120deg, var(--tr-navy) 0%, #1a2a72 100%);
    color: #fff;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 15, 71, .28);
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
    overflow: hidden;
}

    .tr-scan-cta::after {
        content: "";
        position: absolute;
        right: -30px;
        top: -60px;
        width: 180px;
        height: 180px;
        border-radius: 50%;
        background: rgba(214, 11, 40, .18);
    }

    .tr-scan-cta:hover {
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(0, 15, 71, .32);
    }

    .tr-scan-cta:active {
        transform: translateY(0);
    }

.tr-scan-cta-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: var(--tr-radius);
    background: rgba(255, 255, 255, .14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    position: relative;
    z-index: 1;
}

.tr-scan-cta-body {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.tr-scan-cta-title {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.2;
}

.tr-scan-cta-sub {
    font-size: .75rem;
    color: rgba(255, 255, 255, .7);
    margin-top: .1875rem;
}

.tr-scan-cta-arrow {
    margin-left: auto;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
    opacity: .8;
}

/* --------------------------------------------------------------------------
   10. Badges
   -------------------------------------------------------------------------- */
.tr-badge {
    display: inline-flex;
    align-items: center;
    gap: .3125rem;
    padding: .1875rem .5rem;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--tr-radius-sm);
    white-space: nowrap;
}

    .tr-badge > i {
        font-size: .75rem;
    }

.tr-badge-success {
    background: var(--tr-success-bg);
    color: #15773a;
}

.tr-badge-warning {
    background: var(--tr-warning-bg);
    color: #a8660a;
}

.tr-badge-danger {
    background: var(--tr-danger-bg);
    color: #a80a1f;
}

.tr-badge-info {
    background: var(--tr-info-bg);
    color: #0a5e99;
}

.tr-badge-navy {
    background: rgba(0, 15, 71, .08);
    color: var(--tr-navy);
}

.tr-badge-muted {
    background: #eef0f4;
    color: #5c6377;
}

.tr-badge-solid-success {
    background: var(--tr-success);
    color: #fff;
}

.tr-badge-solid-warning {
    background: var(--tr-warning);
    color: #fff;
}

.tr-badge-solid-danger {
    background: var(--tr-danger);
    color: #fff;
}

.tr-badge-solid-navy {
    background: var(--tr-navy);
    color: #fff;
}

/* Status dot */
.tr-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 7px;
}

.tr-dot-success {
    background: var(--tr-success);
}

.tr-dot-warning {
    background: var(--tr-warning);
}

.tr-dot-danger {
    background: var(--tr-danger);
}

.tr-dot-muted {
    background: var(--tr-border-strong);
}

.tr-dot-pulse {
    position: relative;
}

    .tr-dot-pulse::after {
        content: "";
        position: absolute;
        inset: -3px;
        border-radius: 50%;
        border: 2px solid currentColor;
        opacity: .45;
        animation: tr-pulse 1.6s ease-out infinite;
    }

@keyframes tr-pulse {
    0% {
        transform: scale(.7);
        opacity: .6;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Ticket-type pill */
.tr-type {
    font-size: .6875rem;
    font-weight: 600;
    padding: .1875rem .5rem;
    border-radius: var(--tr-radius-sm);
    border: 1px solid;
}

.tr-type-vip {
    color: #8a6100;
    border-color: #f0d59a;
    background: #fdf6e6;
}

.tr-type-regular {
    color: #37507d;
    border-color: #cdd7ea;
    background: #f1f5fc;
}

.tr-type-student {
    color: #146b62;
    border-color: #a9ddd6;
    background: #e8f7f5;
}

.tr-type-early {
    color: #6b3a86;
    border-color: #d9c2e6;
    background: #f7f0fb;
}

/* --------------------------------------------------------------------------
   11. Forms
   -------------------------------------------------------------------------- */
.tr-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--tr-text);
    margin-bottom: .3125rem;
    display: block;
}

.tr-hint {
    font-size: .6875rem;
    color: var(--tr-text-muted);
    margin-top: .3125rem;
}

.tr-input, .tr-select {
    display: block;
    width: 100%;
    padding: .4375rem .6875rem;
    font-size: .8125rem;
    line-height: 1.3846;
    color: var(--tr-text);
    background-color: #fff;
    border: 1px solid var(--tr-border-strong);
    border-radius: var(--tr-radius);
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}

    .tr-input::placeholder {
        color: #a7abbb;
    }

    .tr-input:focus, .tr-select:focus {
        outline: none;
        border-color: var(--tr-navy-400);
        box-shadow: 0 0 0 3px rgba(0, 15, 71, .1);
    }

    .tr-input:disabled, .tr-select:disabled {
        background: #f4f5f8;
        color: var(--tr-text-muted);
    }

.tr-input-lg {
    padding: .625rem .875rem;
    font-size: .9375rem;
}

.tr-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%237c8194'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .5rem center;
    background-size: 14px;
    padding-right: 1.75rem;
}

.tr-input-group {
    display: flex;
    align-items: stretch;
}

    .tr-input-group > .tr-input {
        border-radius: var(--tr-radius) 0 0 var(--tr-radius);
        flex: 1 1 auto;
        min-width: 0;
    }

    .tr-input-group > .tr-btn {
        border-radius: 0 var(--tr-radius) var(--tr-radius) 0;
    }

.tr-input-icon {
    position: relative;
}

    .tr-input-icon > i {
        position: absolute;
        left: .6875rem;
        top: 50%;
        transform: translateY(-50%);
        color: #a7abbb;
        font-size: .9375rem;
        pointer-events: none;
    }

    .tr-input-icon > .tr-input {
        padding-left: 2.125rem;
    }

.tr-check {
    display: inline-flex;
    align-items: center;
    gap: .4375rem;
    font-size: .8125rem;
    cursor: pointer;
}

    .tr-check input[type="checkbox"] {
        width: 15px;
        height: 15px;
        accent-color: var(--tr-navy);
        cursor: pointer;
    }

/* Segmented control */
.tr-segment {
    display: inline-flex;
    background: #eef0f4;
    border-radius: var(--tr-radius);
    padding: 2px;
    gap: 2px;
}

    .tr-segment button {
        border: 0;
        background: transparent;
        padding: .3125rem .6875rem;
        font-size: .75rem;
        font-weight: 500;
        border-radius: var(--tr-radius-sm);
        color: var(--tr-text-muted);
        transition: background-color .15s ease, color .15s ease;
    }

        .tr-segment button:hover {
            color: var(--tr-navy);
        }

        .tr-segment button.active {
            background: #fff;
            color: var(--tr-navy);
            font-weight: 600;
            box-shadow: 0 1px 2px rgba(16, 24, 64, .1);
        }

/* --------------------------------------------------------------------------
   12. Tables
   -------------------------------------------------------------------------- */
.tr-table-wrap {
    overflow-x: auto;
}

.tr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8125rem;
}

    .tr-table thead th {
        padding: .625rem .875rem;
        text-align: left;
        font-size: .6875rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--tr-text-muted);
        background: #fafbfc;
        border-bottom: 1px solid var(--tr-border);
        white-space: nowrap;
    }

    .tr-table tbody td {
        padding: .6875rem .875rem;
        border-bottom: 1px solid var(--tr-border);
        vertical-align: middle;
    }

    .tr-table tbody tr {
        transition: background-color .12s ease;
    }

        .tr-table tbody tr:hover {
            background: #f8f9fc;
        }

        .tr-table tbody tr:last-child td {
            border-bottom: 0;
        }

    .tr-table th.tr-sortable {
        cursor: pointer;
        user-select: none;
    }

        .tr-table th.tr-sortable:hover {
            color: var(--tr-navy);
        }

        .tr-table th.tr-sortable::after {
            content: "\F282"; /* chevron-expand */
            font-family: bootstrap-icons;
            font-size: .625rem;
            margin-left: .3125rem;
            opacity: .4;
        }

        .tr-table th.tr-sortable.tr-sort-asc::after {
            content: "\F235";
            opacity: 1;
            color: var(--tr-navy);
        }

        .tr-table th.tr-sortable.tr-sort-desc::after {
            content: "\F229";
            opacity: 1;
            color: var(--tr-navy);
        }

    .tr-table .tr-td-num {
        font-variant-numeric: tabular-nums;
    }

    .tr-table .tr-td-actions {
        text-align: right;
        white-space: nowrap;
    }

/* Table toolbar */
.tr-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
    align-items: center;
    padding: .875rem 1.125rem;
    border-bottom: 1px solid var(--tr-border);
}

    .tr-table-toolbar .tr-toolbar-spacer {
        margin-left: auto;
    }

/* Filter row */
.tr-filter-bar {
    display: grid;
    gap: .625rem;
    grid-template-columns: 1fr;
    padding: .875rem 1.125rem;
    border-bottom: 1px solid var(--tr-border);
    background: #fbfcfd;
}

@media (min-width: 576px) {
    .tr-filter-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .tr-filter-bar {
        grid-template-columns: repeat(4, 1fr) auto;
        align-items: end;
    }
}

/* Table footer / pagination */
.tr-table-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    padding: .75rem 1.125rem;
    border-top: 1px solid var(--tr-border);
    font-size: .75rem;
    color: var(--tr-text-muted);
}

.tr-pagination {
    display: flex;
    gap: .1875rem;
    margin-left: auto;
    flex-wrap: wrap;
}

    .tr-pagination button {
        min-width: 30px;
        height: 30px;
        padding: 0 .5rem;
        border: 1px solid var(--tr-border-strong);
        background: #fff;
        border-radius: var(--tr-radius-sm);
        font-size: .75rem;
        color: var(--tr-text);
        transition: background-color .12s ease, color .12s ease, border-color .12s ease;
    }

        .tr-pagination button:hover:not(:disabled):not(.active) {
            background: #f4f5f8;
            border-color: var(--tr-border-strong);
            color: var(--tr-navy);
        }

        .tr-pagination button.active {
            background: var(--tr-navy);
            border-color: var(--tr-navy);
            color: #fff;
            font-weight: 600;
        }

        .tr-pagination button:disabled {
            opacity: .45;
            cursor: default;
        }

    .tr-pagination .tr-page-gap {
        border: 0;
        background: transparent;
        pointer-events: none;
    }

/* Mobile card-ified table */
@media (max-width: 767.98px) {
    .tr-table-cards thead {
        display: none;
    }

    .tr-table-cards, .tr-table-cards tbody, .tr-table-cards tr, .tr-table-cards td {
        display: block;
        width: 100%;
    }

        .tr-table-cards tr {
            border: 1px solid var(--tr-border);
            border-radius: var(--tr-radius);
            margin: .75rem;
            padding: .25rem 0;
            background: #fff;
            box-shadow: var(--tr-shadow-card);
        }

            .tr-table-cards tr:hover {
                background: #fff;
            }

        .tr-table-cards td {
            display: flex;
            align-items: center;
            gap: .75rem;
            padding: .4375rem .875rem;
            border-bottom: 0;
        }

            .tr-table-cards td::before {
                content: attr(data-label);
                flex: 0 0 40%;
                font-size: .6875rem;
                font-weight: 700;
                text-transform: uppercase;
                letter-spacing: .05em;
                color: var(--tr-text-muted);
            }

            .tr-table-cards td.tr-td-actions {
                justify-content: flex-start;
                text-align: left;
            }

        .tr-table-cards .tr-td-primary {
            border-bottom: 1px solid var(--tr-border);
            padding-bottom: .625rem;
            margin-bottom: .25rem;
        }
}

/* --------------------------------------------------------------------------
   13. Event cards (event list)
   -------------------------------------------------------------------------- */
.tr-event-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow-card);
    overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

    .tr-event-card:hover {
        box-shadow: var(--tr-shadow-raised);
        transform: translateY(-2px);
        border-color: var(--tr-border-strong);
    }

.tr-event-cover {
    position: relative;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(125deg, var(--tr-navy) 0%, #24337d 100%);
    overflow: hidden;
}

    .tr-event-cover::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 18% 120%, rgba(214, 11, 40, .45), transparent 55%);
    }

    .tr-event-cover > i {
        font-size: 2.25rem;
        opacity: .3;
        position: relative;
        z-index: 1;
    }

.tr-event-cat {
    position: absolute;
    top: .625rem;
    left: .625rem;
    z-index: 2;
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: .1875rem .4375rem;
    border-radius: var(--tr-radius-sm);
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(2px);
    color: #fff;
}

.tr-event-status-pin {
    position: absolute;
    top: .625rem;
    right: .625rem;
    z-index: 2;
}

.tr-event-body {
    padding: .875rem 1rem;
    flex: 1 1 auto;
}

.tr-event-name {
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 .5rem;
}

.tr-event-meta {
    display: flex;
    flex-direction: column;
    gap: .3125rem;
    font-size: .75rem;
    color: var(--tr-text-muted);
}

    .tr-event-meta > div {
        display: flex;
        align-items: center;
        gap: .4375rem;
    }

    .tr-event-meta i {
        font-size: .875rem;
        color: var(--tr-navy-400);
        flex: 0 0 14px;
    }

.tr-event-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--tr-border);
    border-bottom: 1px solid var(--tr-border);
    background: #fbfcfd;
}

    .tr-event-numbers > div {
        padding: .5rem .375rem;
        text-align: center;
    }

        .tr-event-numbers > div + div {
            border-left: 1px solid var(--tr-border);
        }

.tr-event-num-value {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--tr-heading);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.tr-event-num-label {
    font-size: .625rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tr-text-muted);
    margin-top: .0625rem;
}

.tr-event-foot {
    padding: .875rem 1rem;
}

/* --------------------------------------------------------------------------
   14. Progress
   -------------------------------------------------------------------------- */
.tr-progress {
    height: 6px;
    background: #e9ebf1;
    border-radius: 3px;
    overflow: hidden;
}

.tr-progress-lg {
    height: 14px;
    border-radius: 7px;
}

.tr-progress-xl {
    height: 22px;
    border-radius: 4px;
}

.tr-progress-bar {
    height: 100%;
    background: var(--tr-navy);
    border-radius: inherit;
    transition: width .6s cubic-bezier(.22, .61, .36, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: .5rem;
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
}

.tr-progress-bar-success {
    background: var(--tr-success);
}

.tr-progress-bar-warning {
    background: var(--tr-warning);
}

.tr-progress-bar-danger {
    background: var(--tr-danger);
}

.tr-progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .13) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .13) 50%, rgba(255, 255, 255, .13) 75%, transparent 75%, transparent);
    background-size: 16px 16px;
}

/* Donut / ring */
.tr-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .tr-ring svg {
        transform: rotate(-90deg);
    }

.tr-ring-track {
    fill: none;
    stroke: #e9ebf1;
}

.tr-ring-value {
    fill: none;
    stroke: var(--tr-success);
    stroke-linecap: round;
    transition: stroke-dashoffset .8s cubic-bezier(.22, .61, .36, 1);
}

.tr-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .tr-ring-label .tr-ring-num {
        font-size: 1.375rem;
        font-weight: 700;
        color: var(--tr-heading);
        line-height: 1;
        letter-spacing: -.02em;
    }

    .tr-ring-label .tr-ring-cap {
        font-size: .625rem;
        text-transform: uppercase;
        letter-spacing: .07em;
        color: var(--tr-text-muted);
        margin-top: .25rem;
    }

/* Simple bar chart (pure CSS/SVG, no chart library) */
.tr-bars {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    height: 160px;
    padding-top: .5rem;
}

.tr-bar-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: .375rem;
}

.tr-bar-track {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: flex-end;
}

.tr-bar {
    width: 100%;
    max-width: 34px;
    margin: 0 auto;
    border-radius: 2px 2px 0 0;
    background: var(--tr-navy);
    position: relative;
    transition: height .7s cubic-bezier(.22, .61, .36, 1);
    min-height: 2px;
}

.tr-bar-alt {
    background: var(--tr-navy-400);
}

.tr-bar:hover {
    filter: brightness(1.18);
}

.tr-bar-label {
    font-size: .625rem;
    color: var(--tr-text-muted);
    text-align: center;
    white-space: nowrap;
}

.tr-bar-value {
    font-size: .6875rem;
    font-weight: 700;
    color: var(--tr-heading);
    font-variant-numeric: tabular-nums;
}

/* Legend */
.tr-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem 1rem;
    font-size: .75rem;
    color: var(--tr-text-muted);
}

.tr-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.tr-legend-swatch {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex: 0 0 9px;
}

/* Stacked distribution bar */
.tr-stack {
    display: flex;
    height: 12px;
    border-radius: 3px;
    overflow: hidden;
    background: #e9ebf1;
}

    .tr-stack > span {
        height: 100%;
        transition: width .6s ease;
    }

/* --------------------------------------------------------------------------
   15. Scanner
   -------------------------------------------------------------------------- */
.tr-scanner-card {
    background: #0c1330;
    border-radius: var(--tr-radius);
    overflow: hidden;
    border: 1px solid #1b2450;
    box-shadow: var(--tr-shadow-card);
}

.tr-scanner-head {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .875rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .8);
    font-size: .75rem;
}

    .tr-scanner-head .tr-scanner-title {
        font-weight: 600;
        color: #fff;
        letter-spacing: .02em;
    }

.tr-scanner-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: radial-gradient(circle at 50% 45%, #1b2450 0%, #0c1330 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    /* Faux camera texture so the idle state doesn't look empty */
    .tr-scanner-stage::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
        background-size: 22px 22px;
        opacity: .8;
    }

/* Camera preview */
[data-scanner-video] {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.tr-scanner-card.is-scanning [data-scanner-video] {
    display: block;
}

.tr-scanner-idle {
    position: relative;
    z-index: 2;
    text-align: center;
    color: rgba(255, 255, 255, .55);
    padding: 1.5rem;
}

    .tr-scanner-idle .bi {
        font-size: 3rem;
        opacity: .35;
        display: block;
        margin-bottom: .75rem;
    }

.tr-scanner-idle-title {
    font-size: .875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .82);
}

.tr-scanner-idle-text {
    font-size: .75rem;
    margin-top: .25rem;
}

/* QR framing box */
.tr-qr-frame {
    position: relative;
    z-index: 2;
    width: min(62%, 260px);
    aspect-ratio: 1;
    display: none;
}

.tr-scanner-card.is-scanning .tr-qr-frame {
    display: block;
}

.tr-scanner-card.is-scanning .tr-scanner-idle {
    display: none;
}

/* Dim everything outside the QR box */
.tr-scanner-card.is-scanning .tr-scanner-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 28, .45);
    z-index: 1;
}

.tr-qr-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--tr-success);
    border-radius: 2px;
}

    .tr-qr-corner:nth-child(1) {
        top: 0;
        left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .tr-qr-corner:nth-child(2) {
        top: 0;
        right: 0;
        border-left: 0;
        border-bottom: 0;
    }

    .tr-qr-corner:nth-child(3) {
        bottom: 0;
        left: 0;
        border-right: 0;
        border-top: 0;
    }

    .tr-qr-corner:nth-child(4) {
        bottom: 0;
        right: 0;
        border-left: 0;
        border-top: 0;
    }

.tr-qr-laser {
    position: absolute;
    left: 6px;
    right: 6px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--tr-success), transparent);
    box-shadow: 0 0 12px 1px rgba(30, 158, 74, .8);
    animation: tr-laser 2.1s cubic-bezier(.45, 0, .55, 1) infinite;
}

@keyframes tr-laser {
    0%, 100% {
        top: 6px;
    }

    50% {
        top: calc(100% - 8px);
    }
}

.tr-scanner-hint {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    z-index: 3;
    text-align: center;
    font-size: .75rem;
    color: rgba(255, 255, 255, .72);
    display: none;
}

.tr-scanner-card.is-scanning .tr-scanner-hint {
    display: block;
}

/* Live indicator */
.tr-live {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .5);
    margin-left: auto;
}

.tr-scanner-card.is-scanning .tr-live {
    color: var(--tr-success);
}

    .tr-scanner-card.is-scanning .tr-live .tr-dot {
        background: var(--tr-success);
        color: var(--tr-success);
    }

.tr-scanner-toolbar {
    display: flex;
    gap: .5rem;
    padding: .75rem .875rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: #0a1029;
    flex-wrap: wrap;
}

    .tr-scanner-toolbar .tr-btn {
        flex: 1 1 auto;
    }

/* Manual entry */
.tr-manual-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--tr-text-muted);
    font-size: .75rem;
    margin: 1.125rem 0;
}

    .tr-manual-divider::before, .tr-manual-divider::after {
        content: "";
        flex: 1 1 auto;
        height: 1px;
        background: var(--tr-border);
    }

/* --------------------------------------------------------------------------
   16. Scan result states
   -------------------------------------------------------------------------- */
.tr-result {
    border-radius: var(--tr-radius);
    overflow: hidden;
    border: 1px solid var(--tr-border);
    background: #fff;
    box-shadow: var(--tr-shadow-card);
    animation: tr-result-in .28s cubic-bezier(.22, .61, .36, 1);
}

@keyframes tr-result-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tr-result-banner {
    padding: 1.5rem 1.25rem;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.tr-result-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto .75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.125rem;
    position: relative;
    z-index: 1;
    animation: tr-pop .35s cubic-bezier(.2, 1.3, .5, 1);
}

@keyframes tr-pop {
    0% {
        transform: scale(.4);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ripple on success */
.tr-result-icon::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .55);
    animation: tr-ripple 1.4s ease-out .15s 2;
}

@keyframes tr-ripple {
    0% {
        transform: scale(.85);
        opacity: .75;
    }

    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

.tr-result-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -.01em;
    position: relative;
    z-index: 1;
}

.tr-result-msg {
    font-size: .8125rem;
    color: rgba(255, 255, 255, .85);
    margin: .3125rem 0 0;
    position: relative;
    z-index: 1;
}

.tr-result-status {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-top: .875rem;
    padding: .3125rem .75rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, .2);
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.tr-result-valid .tr-result-banner {
    background: linear-gradient(135deg, #1e9e4a 0%, #157a38 100%);
}

.tr-result-used .tr-result-banner {
    background: linear-gradient(135deg, #e8940e 0%, #c06f05 100%);
}

.tr-result-invalid .tr-result-banner {
    background: linear-gradient(135deg, #d60b28 0%, #97071c 100%);
}

.tr-result-wrong .tr-result-banner {
    background: linear-gradient(135deg, #e5541c 0%, #b02a10 100%);
}

.tr-result-cancel .tr-result-banner {
    background: linear-gradient(135deg, #6b7280 0%, #3f4551 100%);
}

.tr-result-body {
    padding: 1.125rem;
}

/* Detail rows */
.tr-detail-list {
    display: flex;
    flex-direction: column;
}

.tr-detail-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: .5625rem 0;
    border-bottom: 1px dashed var(--tr-border);
    font-size: .8125rem;
}

    .tr-detail-row:last-child {
        border-bottom: 0;
    }

.tr-detail-label {
    flex: 0 0 40%;
    max-width: 170px;
    color: var(--tr-text-muted);
    font-size: .75rem;
}

.tr-detail-value {
    flex: 1 1 auto;
    font-weight: 600;
    color: var(--tr-heading);
    text-align: right;
    word-break: break-word;
}

@media (min-width: 576px) {
    .tr-detail-value {
        text-align: left;
    }
}

/* Emphasised ticket number */
.tr-ticket-no {
    display: inline-flex;
    align-items: center;
    gap: .4375rem;
    font-family: "Cascadia Mono", Consolas, "SF Mono", "Roboto Mono", monospace;
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--tr-navy);
}

/* Result placeholder (no scan yet) */
.tr-result-empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
    border: 1px dashed var(--tr-border-strong);
    border-radius: var(--tr-radius);
    background: #fbfcfd;
    color: var(--tr-text-muted);
}

    .tr-result-empty .bi {
        font-size: 2.5rem;
        opacity: .3;
        display: block;
        margin-bottom: .75rem;
    }

/* --------------------------------------------------------------------------
   17. Empty / loading states
   -------------------------------------------------------------------------- */
.tr-empty {
    text-align: center;
    padding: 3rem 1.25rem;
    color: var(--tr-text-muted);
}

.tr-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #f0f2f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--tr-navy-400);
}

.tr-empty-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--tr-heading);
    margin-bottom: .3125rem;
}

.tr-empty-text {
    font-size: .8125rem;
    max-width: 380px;
    margin: 0 auto;
}

.tr-skeleton {
    background: linear-gradient(90deg, #eef0f4 25%, #f6f7fa 37%, #eef0f4 63%);
    background-size: 400% 100%;
    animation: tr-shimmer 1.3s ease-in-out infinite;
    border-radius: var(--tr-radius-sm);
}

@keyframes tr-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

.tr-skeleton-line {
    height: 10px;
    margin-bottom: .5rem;
}

/* --------------------------------------------------------------------------
   18. Dropdowns / modals / toasts (Bootstrap overrides)
   -------------------------------------------------------------------------- */
.dropdown-menu {
    font-size: .8125rem;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow-raised);
    padding: .3125rem 0;
    color: var(--tr-text);
}

.dropdown-item {
    padding: .4375rem 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--tr-text);
}

    .dropdown-item > i {
        font-size: .9375rem;
        color: var(--tr-text-muted);
        width: 16px;
    }

    .dropdown-item:hover, .dropdown-item:focus {
        background: #f4f5f8;
        color: var(--tr-navy);
    }

        .dropdown-item:hover > i {
            color: var(--tr-navy);
        }

    .dropdown-item.text-danger > i, .dropdown-item.text-danger {
        color: var(--tr-danger) !important;
    }

        .dropdown-item.text-danger:hover {
            background: var(--tr-danger-bg);
        }

.dropdown-divider {
    border-color: var(--tr-border);
    margin: .3125rem 0;
}

.dropdown-header {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    color: var(--tr-text-muted);
    padding: .5rem 1rem .3125rem;
}

.tr-dropdown-wide {
    min-width: 300px;
}

/* Notification list */
.tr-notif {
    display: flex;
    gap: .625rem;
    padding: .625rem 1rem;
    border-bottom: 1px solid var(--tr-border);
}

    .tr-notif:last-of-type {
        border-bottom: 0;
    }

    .tr-notif:hover {
        background: #f8f9fc;
    }

.tr-notif-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .875rem;
}

.tr-notif-body {
    min-width: 0;
}

.tr-notif-title {
    font-size: .75rem;
    font-weight: 600;
    color: var(--tr-heading);
}

.tr-notif-text {
    font-size: .6875rem;
    color: var(--tr-text-muted);
}

.tr-notif-time {
    font-size: .625rem;
    color: #a7abbb;
    margin-top: .125rem;
}

/* Modal */
.modal-content {
    border: 0;
    border-radius: var(--tr-radius);
    box-shadow: 0 12px 40px rgba(11, 16, 38, .28);
}

.modal-header {
    padding: .875rem 1.125rem;
    border-bottom: 1px solid var(--tr-border);
}

.modal-title {
    font-size: .9375rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.125rem;
    font-size: .8125rem;
}

.modal-footer {
    padding: .8125rem 1.125rem;
    border-top: 1px solid var(--tr-border);
    background: #fcfcfd;
    gap: .5rem;
}

    .modal-footer > * {
        margin: 0;
    }

/* Toasts */
.tr-toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(340px, calc(100vw - 2rem));
}

.tr-toast {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: .75rem .875rem;
    background: #fff;
    border: 1px solid var(--tr-border);
    border-left: 3px solid var(--tr-navy);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow-raised);
    animation: tr-toast-in .22s cubic-bezier(.22, .61, .36, 1);
}

    .tr-toast.is-leaving {
        animation: tr-toast-out .2s ease forwards;
    }

@keyframes tr-toast-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes tr-toast-out {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.tr-toast-icon {
    font-size: 1rem;
    line-height: 1.2;
    flex: 0 0 auto;
}

.tr-toast-body {
    flex: 1 1 auto;
    min-width: 0;
}

.tr-toast-title {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--tr-heading);
}

.tr-toast-text {
    font-size: .75rem;
    color: var(--tr-text-muted);
    margin-top: .0625rem;
}

.tr-toast-close {
    border: 0;
    background: transparent;
    color: var(--tr-text-muted);
    font-size: .875rem;
    padding: 0;
    line-height: 1;
}

    .tr-toast-close:hover {
        color: var(--tr-text);
    }

.tr-toast-success {
    border-left-color: var(--tr-success);
}

    .tr-toast-success .tr-toast-icon {
        color: var(--tr-success);
    }

.tr-toast-warning {
    border-left-color: var(--tr-warning);
}

    .tr-toast-warning .tr-toast-icon {
        color: var(--tr-warning);
    }

.tr-toast-danger {
    border-left-color: var(--tr-danger);
}

    .tr-toast-danger .tr-toast-icon {
        color: var(--tr-danger);
    }

.tr-toast-info {
    border-left-color: var(--tr-info);
}

    .tr-toast-info .tr-toast-icon {
        color: var(--tr-info);
    }

/* Below lg the bottom action bar owns the foot of the screen, so toasts have
   to sit above it or they cover the navigation entirely. */
@media (max-width: 991.98px) {
    .tr-toast-stack {
        bottom: calc(62px + env(safe-area-inset-bottom, 0px) + .5rem);
    }
}

@media (max-width: 575.98px) {
    .tr-toast-stack {
        right: .625rem;
        left: .625rem;
        width: auto;
    }
}

/* --------------------------------------------------------------------------
   19. Timeline (recent check-ins)
   -------------------------------------------------------------------------- */
.tr-timeline {
    position: relative;
    padding-left: 1.25rem;
}

    .tr-timeline::before {
        content: "";
        position: absolute;
        left: 5px;
        top: 6px;
        bottom: 6px;
        width: 1px;
        background: var(--tr-border);
    }

.tr-timeline-item {
    position: relative;
    padding: 0 0 1rem;
}

    .tr-timeline-item:last-child {
        padding-bottom: 0;
    }

    .tr-timeline-item::before {
        content: "";
        position: absolute;
        left: -1.25rem;
        top: 4px;
        width: 11px;
        height: 11px;
        border-radius: 50%;
        background: #fff;
        border: 2px solid var(--tr-success);
    }

    .tr-timeline-item.is-warning::before {
        border-color: var(--tr-warning);
    }

    .tr-timeline-item.is-danger::before {
        border-color: var(--tr-danger);
    }

.tr-timeline-title {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--tr-heading);
}

.tr-timeline-meta {
    font-size: .6875rem;
    color: var(--tr-text-muted);
    margin-top: .125rem;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .625rem;
}

/* Rank list (gates) */
.tr-rank-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem 0;
    border-bottom: 1px solid var(--tr-border);
}

    .tr-rank-row:last-child {
        border-bottom: 0;
    }

.tr-rank-badge {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: var(--tr-radius-sm);
    background: rgba(0, 15, 71, .07);
    color: var(--tr-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .6875rem;
    font-weight: 700;
}

.tr-rank-body {
    flex: 1 1 auto;
    min-width: 0;
}

.tr-rank-name {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--tr-heading);
}

.tr-rank-value {
    font-size: .875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--tr-heading);
}

/* --------------------------------------------------------------------------
   20. Login screen
   -------------------------------------------------------------------------- */
body.tr-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: radial-gradient(circle at 12% 8%, rgba(214, 11, 40, .22), transparent 42%), radial-gradient(circle at 88% 92%, rgba(36, 51, 125, .55), transparent 46%), var(--tr-navy);
    position: relative;
    overflow: hidden;
}

    body.tr-login-page::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
        background-size: 40px 40px;
    }

.tr-login-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
}

.tr-login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

    .tr-login-brand .tr-brand-mark {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        font-size: 1.5rem;
        margin: 0 auto .75rem;
    }

.tr-login-brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.tr-login-brand-sub {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: rgba(255, 255, 255, .55);
    margin-top: .375rem;
}

.tr-login-card {
    background: #fff;
    border-radius: var(--tr-radius);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
    overflow: hidden;
}

.tr-login-card-head {
    padding: 1.5rem 1.5rem .25rem;
    text-align: center;
}

.tr-login-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.tr-login-card-sub {
    font-size: .8125rem;
    color: var(--tr-text-muted);
    margin: .375rem 0 0;
}

.tr-login-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.tr-login-foot {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .6875rem;
    color: rgba(255, 255, 255, .45);
    line-height: 1.7;
}

    .tr-login-foot a {
        color: rgba(255, 255, 255, .7);
    }

        .tr-login-foot a:hover {
            color: #fff;
        }

.tr-demo-note {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    padding: .625rem .75rem;
    border-radius: var(--tr-radius-sm);
    background: var(--tr-info-bg);
    border: 1px solid #cfe3f5;
    font-size: .6875rem;
    color: #0a5e99;
    line-height: 1.5;
}

    .tr-demo-note i {
        font-size: .875rem;
        flex: 0 0 auto;
        margin-top: .0625rem;
    }

/* --------------------------------------------------------------------------
   21. Mobile scanner experience
   -------------------------------------------------------------------------- */
.tr-mobile-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: #fff;
    border-top: 1px solid var(--tr-border);
    box-shadow: 0 -2px 12px rgba(16, 24, 64, .1);
    padding: .375rem .25rem calc(.375rem + env(safe-area-inset-bottom, 0px));
}

.tr-mobile-bar-inner {
    display: flex;
    align-items: stretch;
}

.tr-mobile-link {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1875rem;
    padding: .375rem .125rem;
    font-size: .625rem;
    font-weight: 500;
    color: var(--tr-text-muted);
    border-radius: var(--tr-radius-sm);
    min-width: 0;
}

    .tr-mobile-link > i {
        font-size: 1.125rem;
    }

    .tr-mobile-link.active {
        color: var(--tr-navy);
        font-weight: 600;
    }

    .tr-mobile-link span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* Centre scan button */
.tr-mobile-link-scan {
    position: relative;
}

    .tr-mobile-link-scan > i {
        width: 42px;
        height: 42px;
        margin-top: -18px;
        border-radius: 50%;
        background: var(--tr-red);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        box-shadow: 0 3px 10px rgba(214, 11, 40, .42);
        border: 3px solid #fff;
    }

.tr-mobile-link-scan {
    color: var(--tr-red);
}

    .tr-mobile-link-scan.active {
        color: var(--tr-red);
    }

@media (max-width: 991.98px) {
    .tr-mobile-bar {
        display: block;
    }

    .tr-shell {
        padding-bottom: 62px;
    }
    /* Nothing important should hide behind the bar */
    .tr-footer {
        padding-bottom: 1rem;
    }
}

/* Focus mode: scanner takes over the viewport on small screens */
@media (max-width: 767.98px) {
    body.tr-scan-focus .tr-hide-on-scan-mobile {
        display: none !important;
    }

    body.tr-scan-focus .tr-content {
        padding: .75rem;
    }

    body.tr-scan-focus .tr-page-header-content {
        padding: .625rem .75rem;
    }

    body.tr-scan-focus .tr-card {
        margin-bottom: .875rem;
    }
}

/* Sticky mobile "scan next" action */
.tr-sticky-action {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: linear-gradient(to top, #fff 62%, rgba(255, 255, 255, 0));
    padding: .75rem 0 .25rem;
}

/* --------------------------------------------------------------------------
   22. Utilities
   -------------------------------------------------------------------------- */
.tr-divider-v {
    width: 1px;
    align-self: stretch;
    background: var(--tr-border);
    margin: 0 .25rem;
}

.tr-navbar .tr-divider-v {
    background: rgba(255, 255, 255, .14);
    margin: .5rem .375rem;
}

.tr-gap-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.tr-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-nowrap {
    white-space: nowrap;
}

.tr-kbd {
    display: inline-block;
    padding: .0625rem .3125rem;
    font-size: .625rem;
    font-family: "Cascadia Mono", Consolas, monospace;
    color: var(--tr-text);
    background: #f4f5f8;
    border: 1px solid var(--tr-border-strong);
    border-bottom-width: 2px;
    border-radius: 3px;
}

.tr-link-muted {
    color: var(--tr-text-muted);
}

    .tr-link-muted:hover {
        color: var(--tr-navy);
    }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Print */
@media print {
    .tr-navbar, .tr-sidebar, .tr-mobile-bar, .tr-page-header-actions, .tr-toast-stack, .tr-footer {
        display: none !important;
    }

    .tr-content-wrapper {
        margin-left: 0 !important;
    }

    .tr-shell {
        padding-top: 0;
    }

    .tr-card {
        box-shadow: none;
        break-inside: avoid;
    }

    body.tr-body {
        background: #fff;
    }
}

/* --------------------------------------------------------------------------
   23. Additions used by the page templates
   -------------------------------------------------------------------------- */

/* Flex/grid children need this to allow text truncation inside them. */
.min-w-0 {
    min-width: 0 !important;
}

/* Collapsed sidebar: swap section headings for a compact marker. */
.tr-sidebar-show {
    display: none;
}

.tr-shell.tr-sidebar-collapsed .tr-sidebar-show {
    display: inline-block !important;
}

.tr-shell.tr-sidebar-collapsed .tr-sidebar-heading {
    padding-top: .75rem;
    padding-bottom: .25rem;
}

/* Bootstrap form switches, restyled to the brand palette. */
.form-check-input {
    width: 2.25rem;
    height: 1.125rem;
    cursor: pointer;
    border-color: var(--tr-border-strong);
}

    .form-check-input:checked {
        background-color: var(--tr-navy);
        border-color: var(--tr-navy);
    }

    .form-check-input:focus {
        border-color: var(--tr-navy-400);
        box-shadow: 0 0 0 3px rgba(0, 15, 71, .12);
    }

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E");
}

/* The ripple belongs to the success state only — it reads as celebratory,
   which is wrong on a rejection. */
.tr-result-icon::after {
    display: none;
}

.tr-result-valid .tr-result-icon::after {
    display: block;
}

/* Keep long dropdowns usable on short screens. */
.dropdown-menu {
    max-height: min(70vh, 480px);
    overflow-y: auto;
}

@media (max-width: 575.98px) {
    .tr-dropdown-wide {
        min-width: 0;
        width: calc(100vw - 1.5rem);
    }
}

/* Table footer select shouldn't stretch. */
.tr-table-footer .tr-select {
    min-width: 68px;
}

/* Bootstrap's close button, tinted to match the panel. */
.btn-close:focus {
    box-shadow: 0 0 0 3px rgba(0, 15, 71, .14);
}

/* Cards that sit in an equal-height row shouldn't add their own gap. */
.row > [class*="col"] > .tr-card.h-100 {
    margin-bottom: 0;
}

/* Bars chart: keep the value label from collapsing when a bar is tiny. */
.tr-bar-col .tr-bar-value {
    min-height: 1em;
}

/* Stat cards inside a 2-up mobile grid need room for long numbers. */
@media (max-width: 575.98px) {
    .tr-stat {
        padding: .875rem;
        gap: .625rem;
    }

    .tr-stat-icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: .9375rem;
    }

    .tr-stat-value {
        font-size: 1.25rem;
    }

    .tr-stat-caption {
        display: none;
    }
}

/* Scanner stage: taller framing on phones, where the camera is portrait. */
@media (max-width: 575.98px) {
    .tr-scanner-stage {
        aspect-ratio: 3 / 4;
    }

    .tr-qr-frame {
        width: min(72%, 280px);
    }

    .tr-scanner-toolbar .tr-btn {
        flex: 1 1 100%;
    }

    .tr-scanner-toolbar .tr-btn-icon {
        flex: 0 0 auto;
    }

    .tr-result-title {
        font-size: 1.1875rem;
    }

    .tr-result-banner {
        padding: 1.25rem 1rem;
    }
}

/* On short landscape phones the scanner would otherwise scroll off-screen. */
@media (max-height: 520px) and (orientation: landscape) {
    .tr-scanner-stage {
        aspect-ratio: 16 / 9;
    }
}

/* On the narrowest phones the code field and its button fight for room —
   stack them so the operator can still read what they typed. */
@media (max-width: 359.98px) {
    .tr-input-group {
        flex-direction: column;
    }

        .tr-input-group > .tr-input {
            border-radius: var(--tr-radius);
        }

        .tr-input-group > .tr-btn {
            border-radius: var(--tr-radius);
            margin-top: .5rem;
        }
}

/* --------------------------------------------------------------------------
   Vendor chooser — the screen between sign-in and the dashboard.
   Standalone (no shell): the navbar/sidebar need a vendor to describe, so
   this page carries its own slim top bar instead.
   -------------------------------------------------------------------------- */
body.tr-chooser-page {
    min-height: 100vh;
    background: radial-gradient(circle at 8% 0%, rgba(214, 11, 40, .16), transparent 38%), radial-gradient(circle at 96% 4%, rgba(36, 51, 125, .5), transparent 42%), var(--tr-navy);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

.tr-chooser-bar {
    height: var(--tr-navbar-h);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 .75rem;
    background: rgba(0, 0, 0, .18);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.tr-chooser-main {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 1.75rem 1rem 2.5rem;
}

.tr-chooser-wrap {
    width: 100%;
    max-width: 1180px;
    min-width: 0;
    margin: 0 auto;
}

.tr-chooser-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tr-chooser-step {
    display: inline-flex;
    align-items: center;
    gap: .4375rem;
    font-size: .625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: rgba(255, 255, 255, .6);
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: .25rem .75rem;
}

.tr-chooser-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
    margin: .875rem 0 0;
}

.tr-chooser-sub {
    font-size: .8125rem;
    color: rgba(255, 255, 255, .6);
    margin: .375rem 0 0;
}

/* Search + filter row sitting on the dark backdrop */
.tr-chooser-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}

    .tr-chooser-tools .tr-input-icon {
        flex: 1 1 240px;
        min-width: 0;
    }

    .tr-chooser-tools .tr-select {
        flex: 1 1 150px;
        width: auto;
        min-width: 0;
    }

    .tr-chooser-tools .tr-segment {
        flex: 0 0 auto;
        margin-left: auto;
    }

.tr-chooser-count {
    font-size: .75rem;
    color: rgba(255, 255, 255, .55);
    margin-bottom: .625rem;
}

    .tr-chooser-count strong {
        color: #fff;
        font-weight: 600;
    }

/* Recently used vendors — one tap back into yesterday's gate */
.tr-recent-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.tr-recent-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .375rem .75rem .375rem .375rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .85);
    font-size: .75rem;
    font-weight: 600;
    transition: background-color .12s ease, border-color .12s ease;
}

    .tr-recent-chip:hover {
        background: rgba(255, 255, 255, .16);
        border-color: rgba(255, 255, 255, .3);
        color: #fff;
    }

    .tr-recent-chip .tr-vendor-logo {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        font-size: .625rem;
        border-radius: 50%;
    }

/* Vendor card */
.tr-vendor-card {
    background: var(--tr-card-bg);
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow-card);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

    .tr-vendor-card:hover {
        box-shadow: var(--tr-shadow-raised);
        transform: translateY(-2px);
        border-color: var(--tr-border-strong);
    }

    .tr-vendor-card.is-current {
        border-color: var(--tr-navy);
        box-shadow: 0 0 0 1px var(--tr-navy);
    }

    .tr-vendor-card.is-suspended {
        opacity: .72;
    }

        .tr-vendor-card.is-suspended:hover {
            transform: none;
        }

.tr-vendor-head {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1rem .75rem;
}

.tr-vendor-logo-img {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: var(--tr-radius);
    object-fit: initial;
    display: block;
}

.tr-vendor-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: var(--tr-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9375rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: var(--tr-navy);
}

.tr-vendor-logo-red {
    background: linear-gradient(135deg, #d60b28, #8e0619);
}

.tr-vendor-logo-navy {
    background: linear-gradient(135deg, #14276f, #000f47);
}

.tr-vendor-logo-teal {
    background: linear-gradient(135deg, #10877c, #0a5a52);
}

.tr-vendor-logo-violet {
    background: linear-gradient(135deg, #6b3a86, #46225a);
}

.tr-vendor-logo-amber {
    background: linear-gradient(135deg, #e08a0b, #9c5f06);
}

.tr-vendor-logo-slate {
    background: linear-gradient(135deg, #5c6377, #3a3f4d);
}

.tr-vendor-id {
    min-width: 0;
    flex: 1 1 auto;
}

.tr-vendor-name {
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 .25rem;
}

.tr-vendor-code {
    font-size: .6875rem;
    color: var(--tr-text-muted);
    font-family: "Cascadia Mono", Consolas, "SF Mono", "Roboto Mono", monospace;
    letter-spacing: .04em;
}

.tr-vendor-meta {
    display: flex;
    flex-direction: column;
    gap: .3125rem;
    padding: 0 1rem .875rem;
    font-size: .75rem;
    color: var(--tr-text-muted);
}

    .tr-vendor-meta > div {
        display: flex;
        align-items: center;
        gap: .4375rem;
    }

    .tr-vendor-meta i {
        font-size: .875rem;
        color: var(--tr-navy-400);
        flex: 0 0 14px;
    }

.tr-vendor-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--tr-border);
    border-bottom: 1px solid var(--tr-border);
    background: #fafbfd;
}

    .tr-vendor-numbers > div {
        padding: .5rem .375rem;
        text-align: center;
    }

        .tr-vendor-numbers > div + div {
            border-left: 1px solid var(--tr-border);
        }

.tr-vendor-num-value {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--tr-heading);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.tr-vendor-num-label {
    font-size: .625rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tr-text-muted);
    margin-top: .0625rem;
}

.tr-vendor-foot {
    padding: .875rem 1rem;
    margin-top: auto;
}

/* Table view row bits */
.tr-vendor-cell {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
}

    .tr-vendor-cell .tr-vendor-logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: .75rem;
    }

/* Dark-backdrop card wrappers reused for the table + empty states */
.tr-chooser-panel {
    background: var(--tr-card-bg);
    border-radius: var(--tr-radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .26);
    overflow: hidden;
}

.tr-chooser-foot {
    text-align: center;
    margin-top: 1.75rem;
    font-size: .6875rem;
    color: rgba(255, 255, 255, .45);
    line-height: 1.7;
}

    .tr-chooser-foot a {
        color: rgba(255, 255, 255, .7);
    }

        .tr-chooser-foot a:hover {
            color: #fff;
        }

@media (max-width: 575.98px) {
    .tr-chooser-title {
        font-size: 1.25rem;
    }

    .tr-chooser-main {
        padding: 1.25rem .75rem 2rem;
    }
}

/* Vendor strip in the sidebar, above the event strip */
.tr-sidebar-vendor {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .75rem .75rem .25rem;
    padding: .5rem .625rem;
    border-radius: var(--tr-radius);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .85);
}

    .tr-sidebar-vendor:hover {
        background: rgba(255, 255, 255, .12);
        color: #fff;
    }

    .tr-sidebar-vendor .tr-vendor-logo {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
        font-size: .625rem;
    }

.tr-sidebar-vendor-label {
    font-size: .5625rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .5);
}

.tr-sidebar-vendor-name {
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tr-shell.tr-sidebar-collapsed .tr-sidebar-vendor {
    justify-content: center;
    padding: .5rem .25rem;
}
