﻿:root {
    /* ── Triniteq brand palette (Digital Style Guide, Nov 2026) ──────────────── */
    --tq-orange: #FF751A;          /* Bright Orange — primary */
    --tq-orange-hover: #FF5F07;
    --tq-orange-active: #FF941A;
    --tq-coral: #FE3838;           /* Coral — buttons only, never headings */
    --tq-coral-hover: #D4202B;
    --tq-coral-active: #FE5B59;
    --tq-green: #21AD7E;           /* Green — success */
    --tq-green-hover: #219564;
    --tq-green-active: #21C89B;
    --tq-grey: #2B2B2B;            /* Dark Grey — body copy */
    /* Brand tints */
    --tq-orange-tint: #FAE4D3;
    --tq-orange-tint-2: #F1BB92;
    --tq-coral-tint: #F6D8D9;
    --tq-coral-tint-2: #E89E9E;
    --tq-green-tint: #D8EBE4;
    --tq-green-tint-2: #9FD0BD;
    /* Light theme */
    --bg: #F6F9FF;                 /* Zircon */
    --surface: #FFFFFF;
    --surface-2: #FBFCFE;
    --panel: #F1F4FB;
    --text: #2B2B2B;
    --text-sub: #45464B;
    --muted: #6A6C74;
    --muted-2: #9A9CA5;
    --border: rgba(43, 43, 43, .10);
    --border-strong: rgba(43, 43, 43, .18);
    --shadow-sm: 0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
    --shadow: 0 4px 16px rgba(16,24,40,.08), 0 1px 4px rgba(16,24,40,.04);
    --accent: var(--tq-orange);
    --accent-2: var(--tq-coral);
    /* Brand gradient (orange → coral) */
    --tq-gradient: linear-gradient(135deg, var(--tq-orange) 0%, var(--tq-coral) 100%);
    /* Sidebar — dark grey */
    --sidebar-width: 248px;
    --sidebar-bg: #2B2B2B;
    --sidebar-border: rgba(255, 255, 255, .08);
    --sidebar-link-color: rgba(255, 255, 255, .80);
    --sidebar-link-hover: rgba(255, 255, 255, .95);
    --sidebar-active-bg: rgba(255, 117, 26, .16);
    --sidebar-active-border: rgba(255, 117, 26, .38);
    --sidebar-active-text: #FF9349;
    --sidebar-hover-bg: rgba(255, 255, 255, .06);
    --sidebar-icon: rgba(255, 255, 255, .58);
    --sidebar-section: rgba(255, 255, 255, .42);
    /* Topbar */
    --topbar-h: 54px;
    /* Radius — brand leans fully rounded */
    --radius-sm: 8px;
    --radius: 11px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 999px;
}

html, body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Century Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text);
    text-decoration: none;
}

    a:hover {
        color: var(--tq-orange);
    }

/* Text links in copy: green, bold, no underline; hover darker green, underlined
   (style guide "Text links"). Navigation, table names and buttons keep their own look. */
.main p a:not(.btn),
.main .alert a:not(.btn),
.main .form-text a:not(.btn),
.auth-body p a:not(.btn) {
    color: var(--tq-green);
    font-weight: 700;
    text-decoration: none;
}

    .main p a:not(.btn):hover,
    .main .alert a:not(.btn):hover,
    .main .form-text a:not(.btn):hover,
    .auth-body p a:not(.btn):hover {
        color: var(--tq-green-hover);
        text-decoration: underline;
    }

/* ── App shell ──────────────────────────────────────────────────────────────── */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

    .sidebar-inner::-webkit-scrollbar {
        display: none;
    }

/* ── Brand ──────────────────────────────────────────────────────────────────── */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: var(--topbar-h); /* same height as topbar so border lines align */
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

/* Gradient badge variant */
.brand-badge {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 2px 8px rgba(254, 56, 56, .20);
}

/* Image logo variant */
.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 0;
    flex-shrink: 0;
    background-image: url('/images/triniteq_icon-RGB.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    /* screen blend removes the black PNG background on the dark sidebar */
    mix-blend-mode: screen;
}

.brand-text {
    min-width: 0;
}

.brand-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, .50);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Sidebar navigation ─────────────────────────────────────────────────────── */
.side-nav {
    flex: 1;
    padding: 8px 8px 0;
    display: flex;
    flex-direction: column;
}

.tq-nav-section {
    display: flex;
    flex-direction: column;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--sidebar-section);
    padding: 14px 8px 5px;
    margin: 0;
}

/* Nav links — covers both .side-nav a and .tq-nav-link patterns */
.side-nav a,
.tq-nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    margin: 1px 0;
    border-radius: var(--radius-sm);
    color: var(--sidebar-link-color);
    text-decoration: none;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    transition: background .12s, color .12s, border-color .12s;
    justify-content: space-between;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    --icon-color: var(--sidebar-icon, var(--muted));
}

    /* Inner span wrapping icon + label */
    .side-nav a > span,
    .tq-nav-link > span {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        min-width: 0;
    }

    .side-nav a i,
    .tq-nav-link i {
        font-size: 14px;
        color: var(--sidebar-icon, var(--muted));
        flex-shrink: 0;
        width: 15px;
        text-align: center;
        transition: color .12s;
    }

    /* Hover */
    .side-nav a:hover,
    .tq-nav-link:hover {
        background: var(--sidebar-hover-bg);
        color: var(--sidebar-link-hover, var(--text));
        border-color: transparent;
    }

        .side-nav a:hover i,
        .tq-nav-link:hover i {
            color: rgba(255, 255, 255, .70);
        }

    /* Active — left accent bar + tinted background */
    .side-nav a.active,
    .tq-nav-link.active {
        background: var(--sidebar-active-bg);
        color: var(--sidebar-active-text);
        border-color: var(--sidebar-active-border);
        font-weight: 700;
    }

        .side-nav a.active i,
        .tq-nav-link.active i {
            color: var(--tq-orange);
        }

        .side-nav a.active::before,
        .tq-nav-link.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 18%;
            bottom: 18%;
            width: 3px;
            border-radius: 0 3px 3px 0;
            background: var(--tq-orange);
        }

/* Nav badge */
.tq-nav-badge {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ── Sidebar footer ─────────────────────────────────────────────────────────── */
.sidebar-footer {
    margin-top: auto;
    padding: 11px 14px 10px;
    color: rgba(255, 255, 255, .55);
    font-size: 11.5px;
    text-align: center;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

    .sidebar-footer a {
        color: rgba(255, 255, 255, .55);
        text-decoration: none;
    }

        .sidebar-footer a:hover {
            color: rgba(255, 255, 255, .85);
            text-decoration: underline;
        }

.sidebar-footer-text {
    line-height: 1.55;
}

.sidebar-footer-copy {
    margin-top: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, .45);
    line-height: 1.5;
}

/* ── Main area ──────────────────────────────────────────────────────────────── */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    gap: 16px;
    z-index: 5;
    /* Override any legacy margin/border-radius from old definition */
    margin: 0;
    border-radius: 0;
}

.page-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    margin-left: 8px;
}

/* ── Content area ───────────────────────────────────────────────────────────── */
.content-card {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    /* Remove legacy card styles */
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.page-container-fluid {
    width: 100%;
    max-width: none;
    padding: 20px 24px;
}

.page-container {
    width: 100%;
    max-width: none !important;
    padding: 20px 24px;
}

/* ── Auth-wrap ──────────────────────────────────────────────────────────────── */
.auth-wrap {
    /* No max-width — content fills the full column */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px 28px 28px;
    box-shadow: var(--shadow-sm);
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    line-height: 1.2;
}

h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
/* ── Buttons (Triniteq Digital Style Guide, Nov 2026) ──────────────────────────
   All buttons: Inter Bold, 6px corners (square, never pill-shaped), 2px border.
   The guide's 16px / 15px 28px size is for marketing pages; the portal is a dense
   admin tool, so buttons keep the guide's shape and weight at a working size.
   Light backgrounds: primary = coral fill, white text, hover #D4202B fill and
   border; secondary = white fill, coral border and text, hover coral fill. */
.btn {
    font-size: 14px;
    font-weight: 700;
    border-width: 2px;
    border-radius: 6px;
    padding: 7px 16px;
    line-height: 1.4;
    transition: background .12s, border-color .12s, color .12s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sm {
    font-size: 13px;
    padding: 4px 12px;
}

.btn-tq {
    background: var(--tq-coral);
    border: 2px solid var(--tq-coral);
    color: #ffffff !important;
}

/* Brand foreground colour — pairs with Bootstrap's text-* utilities. Pages
   have been using .text-tq on spinners without it being defined, so those
   rendered in the default grey. */
.text-tq {
    color: var(--tq-orange) !important;
}

    .btn-tq:hover,
    .btn-tq:focus-visible {
        background: var(--tq-coral-hover);
        border-color: var(--tq-coral-hover);
        color: #fff;
    }

    .btn-tq:active {
        background: var(--tq-coral-hover) !important;
        border-color: var(--tq-coral-hover) !important;
    }

/* Secondary on light backgrounds: white fill, coral border and text. */
.btn-tq-outline {
    background: #fff;
    border: 2px solid var(--tq-coral);
    color: var(--tq-coral) !important;
}

    .btn-tq-outline:hover,
    .btn-tq-outline:focus-visible {
        background: var(--tq-coral);
        border-color: var(--tq-coral);
        color: #fff !important;
    }

/* Solid brand-green button (Style Guide primary green). */
.btn-tq-green {
    background: var(--tq-green);
    border: 2px solid var(--tq-green);
    color: #fff !important;
}

    .btn-tq-green:hover { background: var(--tq-green-hover); color: #fff; }

    .btn-tq-green:active { background: var(--tq-green-active); }

/* Neutral outline for quiet actions (Cancel, Back): dark grey, same shape. */
.btn-outline-light {
    border-color: var(--border-strong) !important;
    color: var(--text-sub) !important;
    background: var(--surface);
}

    .btn-outline-light:hover {
        background: var(--panel) !important;
        border-color: var(--border-strong) !important;
        color: var(--text) !important;
    }

.btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text-sub);
    background: var(--surface);
}

    .btn-outline-secondary:hover {
        background: var(--panel);
        color: var(--text);
        border-color: var(--border-strong);
    }

.btn-outline-danger {
    color: #c0392b;
    border-color: #fca5a5;
    background: transparent;
}

    .btn-outline-danger:hover {
        background: #fef2f2;
        color: #b91c1c;
        border-color: #f87171;
    }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 5px;
}

.form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    transition: border-color .12s, box-shadow .12s;
    line-height: 1.5;
}

    .form-control:focus {
        border-color: rgba(255, 117, 26, .60);
        box-shadow: 0 0 0 3px rgba(255, 117, 26, .14);
        outline: none;
    }

    .form-control::placeholder {
        color: var(--muted-2);
    }

    .form-control[readonly] {
        background: var(--surface-2);
        color: var(--muted);
    }

.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    font-size: 13px;
    padding: 8px 32px 8px 12px;
    color: var(--text);
    /* background-color, NOT the `background` shorthand — the shorthand resets
       background-image, which is how Bootstrap draws the dropdown chevron. Using
       it here silently stripped the caret from every <select> in the platform,
       leaving them looking like plain text inputs. The 32px right padding above
       is already reserving the space the caret sits in. */
    background-color: var(--surface);
}

    .form-select:focus {
        border-color: rgba(255, 117, 26, .60);
        box-shadow: 0 0 0 3px rgba(255, 117, 26, .14);
    }

.input-group-text {
    border-color: var(--border-strong);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
}

.form-check-input:checked {
    background-color: var(--tq-orange);
    border-color: var(--tq-orange);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 117, 26, .15);
    border-color: var(--tq-orange);
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

    .card.shadow-sm {
        box-shadow: var(--shadow-sm);
    }

.card-body {
    padding: 18px 20px;
}

.card-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.tq-table-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}

.tq-table {
    font-size: 13px;
    color: var(--text);
    margin: 0;
    width: 100%;
}

    .tq-table thead th {
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--muted);
        background: var(--surface-2);
        border-bottom: 1px solid var(--border);
        padding: 10px 14px;
        white-space: nowrap;
    }

    .tq-table tbody tr {
        border-bottom: 1px solid var(--border);
    }

        .tq-table tbody tr:last-child {
            border-bottom: none;
        }

    .tq-table tbody td {
        padding: 11px 14px;
        vertical-align: middle;
        border-top-color: var(--border);
    }

    .tq-table tbody tr:hover td {
        background: var(--surface-2);
    }

/* DataTables */
table.dataTable thead th,
table.dataTable thead td {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border) !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 14px;
}

table.dataTable tbody td {
    padding: 11px 14px;
    font-size: 13px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    font-size: 12px;
    color: var(--muted);
    padding: 10px 14px;
}

    .dataTables_wrapper .dataTables_filter input {
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-sm);
        padding: 5px 10px;
        font-size: 12px;
        margin-left: 6px;
    }

.dt-length select,
.dt-search input {
    border-radius: var(--radius-sm);
}

.dt-paging button {
    border-radius: var(--radius-sm) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    font-size: 12px;
    border-radius: var(--radius-sm) !important;
    padding: 4px 9px !important;
    color: var(--text-sub) !important;
}

    .dataTables_wrapper .dataTables_paginate .paginate_button.current,
    .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
        background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
        border-color: transparent !important;
        color: #fff !important;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
        background: var(--panel) !important;
        border-color: var(--border) !important;
        color: var(--text) !important;
    }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius);
    font-size: 13px;
    padding: 11px 15px;
    border-width: 1px;
}

/* Bootstrap pins the dismiss button with `top: 0` and a fixed 1.25rem of top
   padding, which only lands centred against Bootstrap's own 1rem alert
   padding — we override .alert to 11px, so the cross ends up off-centre.
   Anchoring to 50% and pulling back half its height centres it for any alert
   height, including ones that wrap onto two lines. Horizontal inset stays at
   1rem to match Bootstrap. */
.alert-dismissible .btn-close {
    top: 50%;
    transform: translateY(-50%);
    padding: 0.75rem 1rem;
}

.alert-danger {
    background: #fef3f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

.alert-info {
    background: #eff8ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

/* Status pills that sit in a row with btn-sm controls — e.g. the PowerEPOS
   connection badge next to its "Settings" link. Deliberately matched to the
   .btn-sm box (same font-size, padding and line-height, plus a transparent
   1px border to account for the button's own border) so the two line up at
   the same height instead of the badge reading as a smaller, secondary
   element. Use this anywhere a badge shares a row with buttons; leave plain
   .badge for dense contexts like table cells. */
.tq-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    line-height: 1.5;
    padding: 5px 11px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
}

/* ── Dashboard tiles ────────────────────────────────────────────────────────── */
.tq-dashboard {
    margin-left: auto;
    margin-right: auto;
}

.tq-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    justify-content: center;
}

@media (max-width: 992px) {
    .tq-tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .tq-tile-grid {
        grid-template-columns: 1fr;
    }
}

.tq-tile {
    display: block;
    text-decoration: none;
    padding: 18px 18px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .10s ease, box-shadow .10s ease, border-color .10s ease;
    color: var(--text);
    min-height: 96px;
}

    .tq-tile:hover {
        transform: translateY(-2px);
        border-color: rgba(255, 117, 26, .28);
        box-shadow: var(--shadow);
        color: var(--text);
    }

.tq-tile-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.tq-tile-icon {
    font-size: 17px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(255, 117, 26,.14), rgba(254, 56, 56,.11));
    color: var(--tq-orange);
    border: 1px solid rgba(255, 117, 26,.18);
}

.tq-tile-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 4px;
}

.tq-tile-sub {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
}

.tq-tile-disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
    background: var(--surface-2);
    pointer-events: none;
}

    .tq-tile-disabled:hover {
        transform: none;
        border-color: var(--border);
        box-shadow: none;
    }

    .tq-tile-disabled .tq-tile-icon {
        background: rgba(17,24,39,.04);
        border-color: rgba(17,24,39,.08);
        color: var(--muted);
    }

/* ── Misc ───────────────────────────────────────────────────────────────────── */
.tq-modal-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.tq-local-dt {
    font-variant-numeric: tabular-nums;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

.list-group-item {
    font-size: 13px;
    padding: 11px 15px;
    border-color: var(--border);
    color: var(--text);
}

/* Ledger child rows */
.ledger-child td {
    padding-left: 26px;
    color: rgba(31, 41, 55, .80);
}

    .ledger-child td:nth-child(2) .fw-semibold {
        font-weight: 600 !important;
    }

    .ledger-child td:nth-child(3)::before {
        content: "↳ ";
        color: var(--muted-2);
    }

/* ── Context modal ──────────────────────────────────────────────────────────── */
.tq-context-modal .modal-dialog {
    max-width: 880px;
}

.tq-context-modal .modal-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 50px rgba(17, 24, 39, .18);
    overflow: hidden;
}

.tq-context-modal .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    align-items: flex-start;
}

.tq-context-modal .modal-footer {
    padding: 13px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.tq-context-modal .modal-title {
    font-weight: 900;
    letter-spacing: -0.01em;
    margin: 0;
}

.tq-context-modal .tq-modal-subtitle {
    margin-top: 5px;
    font-size: 13px;
    color: var(--muted);
}

.tq-context-modal .modal-body {
    padding: 14px 20px 20px;
    background: var(--surface);
}

.modal-backdrop.show {
    opacity: .45 !important;
}

.tq-context-modal .tq-org-list {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--surface-2);
}

.tq-context-modal .list-group-item,
.tq-context-modal .tq-org-row {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

    .tq-context-modal .list-group-item:last-child,
    .tq-context-modal .tq-org-row:last-child {
        border-bottom: 0 !important;
    }

.tq-context-modal .tq-org-name {
    font-weight: 800;
    line-height: 1.15;
}

.tq-context-modal .tq-org-role {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.tq-context-modal .tq-select-btn {
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.tq-context-modal .btn-close {
    filter: none;
    opacity: .6;
}

    .tq-context-modal .btn-close:hover {
        opacity: .9;
    }

@media (max-width: 768px) {
    .tq-context-modal .modal-dialog {
        max-width: calc(100% - 18px);
        margin: 9px auto;
    }

    .tq-context-modal .modal-header,
    .tq-context-modal .modal-body,
    .tq-context-modal .modal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .tq-context-modal .tq-org-row {
        align-items: flex-start;
    }
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--muted-2);
    }

/* ── Swagger ────────────────────────────────────────────────────────────────── */
.swagger-ui .topbar {
    display: none;
}

/* ── Mobile nav toggle + backdrop (hidden on desktop) ─────────────────────────── */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}
.nav-toggle:hover { background: var(--panel); }

/* Topbar account control: name + role on desktop, a person icon on mobile; the
   Switch / Sign out buttons live inline on desktop and collapse into the menu on mobile. */
.topbar-user { display: inline-flex; align-items: center; }
.topbar-user-icon { display: none; font-size: 26px; color: var(--text-sub); }
.topbar-menu-mobile { display: none; }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(20, 22, 28, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    /* Off-canvas drawers sit just outside the viewport; clip horizontal overflow so they
       never create a sideways scrollbar (which reads as uneven left/right padding). */
    body { overflow-x: hidden; }

    .app-shell {
        grid-template-columns: 1fr;
    }

    /* Sidebar becomes an off-canvas drawer, hidden until toggled. */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        width: min(84vw, 300px);
        height: 100vh;
        height: 100dvh;
        border-right: 1px solid var(--sidebar-border);
        transform: translateX(-100%);
        transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    }

    /* Shadow only while open, so the closed drawer doesn't cast a strip onto the page. */
    body.nav-open .sidebar { transform: none; box-shadow: 0 16px 48px rgba(0, 0, 0, .38); }

    .sidebar-inner { height: 100%; }

    body.nav-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    body.nav-open { overflow: hidden; }

    /* Main is full-width with normal document scroll; the topbar carries the toggle. */
    .main {
        height: auto;
        overflow: visible;
    }

    .topbar { padding: 0 14px; gap: 8px; }
    .nav-toggle { display: inline-flex; }

    /* Left-align the organisation name; collapse the account block to an icon + menu. */
    #tq-header-context { font-size: 15px; }
    .topbar-user-text { display: none; }
    .topbar-user-icon { display: inline-flex; }
    .topbar-menu-mobile { display: block; }
    .topbar-buttons { display: none; }

    .page-container-fluid,
    .page-container { padding: 16px 14px; }
}

/* ── Lock badge ──────────────────────────────────────────────────────────────
   Reusable red-circle / white-padlock chip used to mark feature-gated nav
   entries and dashboard tiles. Single source of truth for the "this feature
   is not enabled" visual so the sidebar and dashboard stay in sync. */
.tq-lock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e05656;
    flex-shrink: 0;
    transition: background-color .12s ease;
}
.tq-lock-badge i,
.side-nav a .tq-lock-badge i,
.tq-tile .tq-lock-badge i {
    color: #fff;
    font-size: 9px;
    line-height: 1;
    width: auto;
    opacity: 1;
}
.side-nav a.tq-nav-disabled:hover .tq-lock-badge,
.tq-tile-unlicensed:hover .tq-lock-badge {
    background: #ff7373;
}

/* ── Organisation menu (2026-10 redesign) ─────────────────────────────────────
   Venue switcher, grouped apps with the open app's pages beneath it, and the
   account block at the foot of the menu (there is no desktop top bar). */
.tq-venue {
    margin: 4px 0 8px !important;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .06);
    color: #fff !important;
}
.side-nav a.tq-venue .tq-venue-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-nav a.tq-venue .tq-venue-name { display: block; overflow: hidden; text-overflow: ellipsis; }
.side-nav a.tq-venue i.tq-venue-icon { margin-left: auto; color: rgba(255, 255, 255, .55); }
.side-nav a.tq-venue:hover i.tq-venue-icon { color: #FFB27F; }

.tq-nav-pv {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 700;
    color: #FFB27F;
    border: 1px solid rgba(255, 117, 26, .55);
    border-radius: 999px;
    padding: 0 8px;
    line-height: 17px;
}

.tq-nav-sub {
    display: flex;
    flex-direction: column;
    margin: 2px 0 6px 18px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .12);
}
.tq-nav-sub.collapse:not(.show) { display: none; }
.side-nav .tq-nav-sub a,
.tq-side-bottom .tq-nav-sub a {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, .72);
    border: 0;
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.side-nav .tq-nav-sub a:hover,
.tq-side-bottom .tq-nav-sub a:hover { background: var(--sidebar-hover-bg); color: #fff; }
.side-nav .tq-nav-sub a.active { color: #FFB27F; font-weight: 700; background: none; }
.side-nav .tq-nav-sub a.active::before { display: none; }
.tq-nav-lock { margin-left: auto; font-size: 10px; color: #ff8a8a; }

.tq-side-bottom {
    margin-top: auto;
    padding: 10px 8px 6px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}
.tq-side-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--sidebar-link-color);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.tq-side-link > span { display: inline-flex; align-items: center; gap: 9px; }
.tq-side-link i { font-size: 14px; width: 15px; text-align: center; color: var(--sidebar-icon); }
.tq-side-link:hover { background: var(--sidebar-hover-bg); color: #fff; }
.tq-nav-count {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: 0 7px;
    line-height: 18px;
}

.tq-me { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sidebar-border); }
.tq-me-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 6px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
}
.tq-me-btn:hover { background: var(--sidebar-hover-bg); }
.tq-me-av {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--tq-gradient);
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.tq-me-text { flex: 1; min-width: 0; line-height: 1.25; }
.tq-me-name { display: block; font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-me-role { display: block; font-size: 12px; color: rgba(255, 255, 255, .55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-me-more { color: rgba(255, 255, 255, .5); }
.tq-me .dropdown-menu { width: 100%; }

.tq-side-bottom + .sidebar-footer { margin-top: 0; border-top: 0; padding-top: 4px; }

/* The top bar is only the mobile menu button now. */
@media (min-width: 993px) {
    .topbar.topbar-mobile { display: none; }
}

/* Pinned top and bottom: the logo stays at the top, the links, account and version
   stay at the foot, and only the menu list between them scrolls. */
.sidebar-inner { overflow: hidden; }
.side-nav {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 3px; }
.side-nav > * { flex-shrink: 0; }
.tq-side-bottom { margin-top: 0; }

.tq-side-top { padding: 8px 8px 0; flex-shrink: 0; }
.tq-side-top .tq-venue {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 8px 10px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}
.tq-side-top .tq-venue > span { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.tq-side-top .tq-venue i { font-size: 14px; width: 15px; text-align: center; color: var(--sidebar-icon); flex-shrink: 0; }
.tq-side-top .tq-venue .tq-venue-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tq-side-top .tq-venue .tq-venue-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-side-top .tq-venue i.tq-venue-icon { margin-left: auto; color: rgba(255, 255, 255, .55); }
.tq-side-top .tq-venue:hover { background: rgba(255, 255, 255, .1); }
.tq-side-top .tq-venue:hover i.tq-venue-icon { color: #FFB27F; }

.tq-side-scroll { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tq-side-scroll .side-nav { flex: 1; }
.tq-scroll-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: #3A3A3A;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
    cursor: pointer;
}
.tq-scroll-hint[hidden] { display: none; }
.tq-scroll-hint.up { top: 6px; }
.tq-scroll-hint.down { bottom: 6px; }
.tq-scroll-hint:hover { background: var(--tq-orange); border-color: var(--tq-orange); color: var(--tq-grey); }


/* ── Venue details window (after login, venue admins only) ─────────────────── */
.tq-vd-modal .modal-dialog { max-width: 640px; }
.tq-vd-modal .modal-content { border: 0; border-radius: var(--radius-xl); overflow: hidden; box-shadow: 0 24px 60px rgba(17, 24, 39, .22); background: var(--surface); color: var(--text); }
.tq-vd-modal .modal-content::before { content: ""; display: block; height: 5px; background: var(--tq-gradient); flex: none; }
.tq-vd-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 24px 6px; }
.tq-vd-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--tq-orange-tint); color: var(--tq-orange-active); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.tq-vd-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tq-orange); }
.tq-vd-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; line-height: 1.25; }
.tq-vd-sub { font-size: 14px; color: var(--text-sub); margin: 0; }
.tq-vd-body { padding: 14px 24px 8px; }
.tq-vd-label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; display: block; }
.tq-vd-group { font-size: 13px; font-weight: 700; color: var(--text); padding-top: 6px; border-top: 1px solid var(--border); }
.tq-vd-alert { margin: 0 0 14px; padding: 9px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; background: #FFEDED; color: #B42318; }
.tq-vd-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px 20px; }
.tq-vd-link { font-size: 13.5px; font-weight: 600; color: var(--text-sub); text-decoration: none; }
.tq-vd-link:hover { color: var(--tq-orange-active); text-decoration: underline; }
.tq-vd-done { text-align: center; padding: 36px 28px 30px; }
.tq-vd-done-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 999px; background: var(--tq-green-tint); color: var(--tq-green); display: flex; align-items: center; justify-content: center; font-size: 28px; }
@media (max-width: 575.98px) {
    .tq-vd-head { padding: 18px 16px 4px; }
    .tq-vd-icon { display: none; }
    .tq-vd-title { font-size: 19px; }
    .tq-vd-body { padding: 12px 16px 6px; }
    .tq-vd-foot { padding: 12px 16px 16px; }
    .tq-vd-foot .d-flex { width: 100%; }
    .tq-vd-foot .btn { flex: 1; }
}
/* The form sits between the content and the body, so it passes on the scrolling. */
.tq-vd-modal form { display: flex; flex-direction: column; min-height: 0; }
