/* =============================================================
   TBZ TRMCS — Theme Stylesheet
   Color palette: TBZ Green (#2d6a2d) + Gold (#c8a415)
   Approach: Mobile-first, Bootstrap 5 companion
   ============================================================= */

/* ── 1. Design Tokens ─────────────────────────────────────── */
:root {
    /* Primary — TBZ Green */
    --tbz-primary: #0f8a5f;
    --tbz-primary-hover: #0b6b49;
    --tbz-primary-light: #e7f6ef;

    /* Accent — Gold */
    --tbz-gold: #c8a415;
    --tbz-gold-hover: #a88a0f;
    --tbz-gold-light: #fef3d7;

    /* Layout */
    --tbz-sidebar-width: 264px;
    --tbz-topbar-h: 64px;

    /* Surfaces */
    --tbz-sidebar-bg: #ffffff;
    --tbz-topbar-bg: #ffffff;
    --tbz-body-bg: #f6f7f8;

    /* Typography */
    --tbz-text-dark: #1a1d23;
    --tbz-text-muted: #6b7280;
    --tbz-border: #e5e7eb;
    --tbz-shadow-card: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .10);
    --tbz-shadow-card-hover: 0 8px 20px rgba(16, 24, 40, .10);
    --tbz-shadow-float: 0 14px 40px rgba(16, 24, 40, .12);

    /* Module-card icon colours */
    --tbz-mc-green-icon: #2d6a2d;
    --tbz-mc-gold-icon: #c8a415;
    --tbz-mc-teal-icon: #00897b;
    --tbz-mc-blue-icon: #1a73e8;
    --tbz-mc-orange-icon: #e05a2b;
    --tbz-mc-amber-icon: #e65c00;
    /* legacy purple kept for backward compat */
    --tbz-mc-purple-icon: #6c5ce7;
}

/* ── 2. Base / Reset ──────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: var(--tbz-body-bg);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    margin: 0;
    color: var(--tbz-text-dark);
}

/* ── 3. Sidebar — mobile-first (hidden off-screen by default) */
.tbz-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--tbz-sidebar-width);
    background: var(--tbz-sidebar-bg);
    border-right: 1px solid var(--tbz-border);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
}

.tbz-sidebar-nav {
    padding: .25rem 0 .5rem;
}

/* Show sidebar when toggled on mobile */
.tbz-sidebar.tbz-sidebar--open {
    transform: translateX(0);
}

/* From md breakpoint upward: always visible */
@media (min-width: 768px) {
    .tbz-sidebar {
        transform: translateX(0);
        z-index: 1000;
    }
}

/* Logo block */
.tbz-sidebar-logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.4rem 1.25rem 1rem;
    text-decoration: none;
}

.tbz-sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--tbz-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tbz-gold);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tbz-sidebar-logo .logo-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--tbz-text-dark);
    line-height: 1.1;
}

.tbz-sidebar-logo .logo-sub {
    font-size: .65rem;
    color: var(--tbz-text-muted);
    font-weight: 400;
}

/* Section label */
.tbz-nav-section-label {
    padding: .5rem 1.25rem .25rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--tbz-text-muted);
    text-transform: uppercase;
}

/* Nav links */
.tbz-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .85rem;
    margin: .14rem .65rem;
    border-radius: 8px;
    color: #4a5568;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    line-height: 1.25;
    transition: background .15s, color .15s, box-shadow .15s;
}

.tbz-nav-link i {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
}

.tbz-nav-link:hover {
    background: #f3f4f6;
    color: var(--tbz-primary);
}

.tbz-nav-link:focus-visible,
.tbz-nav-group-toggle:focus-visible,
.tbz-signout-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(45, 106, 45, .24);
}

.tbz-nav-link.active {
    background: var(--tbz-primary-light);
    color: var(--tbz-primary) !important;
    font-weight: 600;
}

.tbz-nav-link.active:hover {
    background: #dbf1e7;
}

/* ── Sidebar nav group / dropdown (collapsible section) ────── */
.tbz-nav-group-toggle {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .85rem;
    margin: .14rem .65rem;
    border-radius: 8px;
    color: #4a5568;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    width: calc(100% - 1.3rem);
    text-align: left;
    line-height: 1.25;
    transition: background .15s, color .15s, box-shadow .15s;
}

.tbz-nav-group-toggle:hover {
    background: #f3f4f6;
    color: var(--tbz-primary);
}

.tbz-nav-group-toggle:not(.collapsed) {
    color: var(--tbz-primary);
    background: #f3f4f6;
}

.tbz-nav-group-toggle--active {
    color: var(--tbz-primary);
    background: #f3f4f6;
    font-weight: 600;
}

/* Chevron icon that rotates when group is expanded */
.tbz-nav-caret {
    margin-left: auto;
    font-size: .7rem;
    transition: transform .2s ease;
}

.tbz-nav-group-toggle:not(.collapsed) .tbz-nav-caret {
    transform: rotate(90deg);
}

/* Indent child links inside a collapsed nav group */
.tbz-nav-group-body {
    margin: .2rem .85rem .35rem 1.35rem;
    padding: .2rem 0 .2rem .5rem;
    border-left: 1px dashed var(--tbz-border);
}

.tbz-nav-group-body .tbz-nav-link {
    margin: .12rem 0;
    padding-left: .9rem;
    padding-right: .7rem;
    font-size: .85rem;
    border-radius: 6px;
}

.tbz-nav-group-body .tbz-nav-link.active {
    background: var(--tbz-primary);
    color: #fff !important;
}

/* Sidebar footer & sign-out */
.tbz-sidebar-footer {
    margin-top: auto;
    padding: 1rem .75rem;
    border-top: 1px solid var(--tbz-border);
}

.tbz-signout-btn {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .5rem 1rem;
    border-radius: 8px;
    border: 1.5px solid #e53e3e;
    color: #e53e3e;
    background: transparent;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    justify-content: center;
    transition: background .15s, color .15s;
}

.tbz-signout-btn:hover {
    background: #e53e3e;
    color: #fff;
}

/* Mobile overlay backdrop */
.tbz-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 1040;
}

.tbz-sidebar-overlay.tbz-overlay--open {
    display: block;
}

/* ── 4. Top Bar ───────────────────────────────────────────── */

/* Mobile-first: span full width */
.tbz-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--tbz-topbar-h);
    background: var(--tbz-topbar-bg);
    border-bottom: 1px solid var(--tbz-border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 999;
    gap: .9rem;
}

/* From md: offset by sidebar width */
@media (min-width: 768px) {
    .tbz-topbar {
        left: var(--tbz-sidebar-width);
        padding: 0 1.5rem;
        transition: left .25s ease;
    }

    body.tbz-sidebar-collapsed .tbz-topbar {
        left: 0;
    }
}

/* Sidebar toggle button */
.tbz-menu-toggle {
    background: transparent;
    border: none;
    padding: .35rem .5rem;
    color: var(--tbz-text-dark);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s;
}

.tbz-menu-toggle:hover {
    background: var(--tbz-primary-light);
    color: var(--tbz-primary);
}

.tbz-topbar-search {
    flex: 1;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: .55rem;
    background: #f3f4f6;
    border: 1px solid #eceff3;
    border-radius: 12px;
    padding: .5rem .85rem;
    box-shadow: none;
}

.tbz-topbar-search i {
    color: #9aa3af;
    font-size: 1rem;
}

.tbz-topbar-search-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    cursor: pointer;
    color: inherit;
}

.tbz-topbar-search-btn:hover i,
.tbz-topbar-search-btn:focus-visible i {
    color: var(--tbz-primary);
}

.tbz-topbar-search-btn:focus-visible {
    outline: none;
}

.tbz-topbar-search-input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-size: .9rem;
    color: var(--tbz-text-dark);
}

.tbz-topbar-search-input::placeholder {
    color: #9aa3af;
}

.tbz-topbar-search:focus-within {
    border-color: rgba(15, 138, 95, .35);
    box-shadow: 0 0 0 4px rgba(15, 138, 95, .12);
    background: #fff;
}

.tbz-topbar-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

@media (min-width: 576px) {
    .tbz-topbar-actions {
        gap: 1rem;
    }
}

.tbz-datetime {
    display: none;
    /* hidden on very small screens */
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--tbz-text-muted);
    white-space: nowrap;
}

@media (min-width: 640px) {
    .tbz-datetime {
        display: flex;
    }
}

.tbz-user-chip {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    border: 1px solid var(--tbz-border);
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    color: var(--tbz-text-dark);
    font-size: .85rem;
}

.tbz-user-chip:hover {
    border-color: var(--tbz-primary);
    color: var(--tbz-text-dark);
}

.tbz-user-chip .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--tbz-primary);
    color: var(--tbz-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tbz-user-chip .uname {
    font-weight: 600;
    display: none;
}

.tbz-user-chip .urole {
    font-size: .72rem;
    color: var(--tbz-text-muted);
    display: none;
}

@media (min-width: 480px) {
    .tbz-user-chip {
        gap: .5rem;
        padding: .3rem .75rem;
    }

    .tbz-user-chip .uname {
        display: block;
    }

    .tbz-user-chip .urole {
        display: block;
    }
}

.tbz-notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--tbz-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    text-decoration: none;
    font-size: 1rem;
    flex-shrink: 0;
}

.tbz-notif-btn:hover {
    border-color: var(--tbz-primary);
    color: var(--tbz-primary);
}

.tbz-notif-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: .6rem;
    background: var(--tbz-gold) !important;
    color: #fff;
}

/* User dropdown menu */
.tbz-user-dropdown {
    min-width: 180px;
    border-radius: 12px !important;
    border: 0 !important;
}

/* ── 5. Main Content Area — mobile-first ──────────────────── */

/* No left margin on mobile */
.tbz-main {
    margin-left: 0;
    padding-top: var(--tbz-topbar-h);
    min-height: 100vh;
}

/* From md: offset by sidebar */
@media (min-width: 768px) {
    .tbz-main {
        margin-left: var(--tbz-sidebar-width);
        transition: margin-left .25s ease;
    }

    body.tbz-sidebar-collapsed .tbz-main {
        margin-left: 0;
    }

    body.tbz-sidebar-collapsed .tbz-sidebar {
        transform: translateX(-100%);
    }
}

/* Content padding — grows with viewport */
.tbz-content {
    padding: 1rem;
}

@media (min-width: 576px) {
    .tbz-content {
        padding: 1.25rem;
    }
}

@media (min-width: 992px) {
    .tbz-content {
        padding: 1.5rem 1.75rem;
    }
}

/* Anonymous layout container */
.tbz-anon-container {
    max-width: 960px;
}

/* ── 6. Breadcrumb Bar ────────────────────────────────────── */
.tbz-breadcrumb-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.tbz-breadcrumb {
    font-size: .85rem;
    color: var(--tbz-text-muted);
}

.tbz-breadcrumb a {
    color: var(--tbz-text-muted);
    text-decoration: none;
}

.tbz-breadcrumb a:hover {
    color: var(--tbz-primary);
}

.tbz-breadcrumb .sep {
    margin: 0 .35rem;
}

.tbz-breadcrumb .current {
    color: var(--tbz-primary);
    font-weight: 600;
}

/* ── 7. Module Cards ──────────────────────────────────────── */
.module-card {
    --mc-accent: var(--tbz-primary);
    --mc-bg1: #f3fbf3;
    --mc-bg2: #e6f6e6;
    border-radius: 14px;
    padding: 1rem 1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    background: #ffffff;
    border: 1px solid var(--tbz-border);
    box-shadow: var(--tbz-shadow-card);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
    text-decoration: none;
    color: var(--tbz-text-dark);
    position: relative;
    overflow: hidden;
}

.module-card::before,
.module-card::after {
    content: none;
}

.module-card>* {
    position: relative;
    z-index: 1;
}

@media (min-width: 576px) {
    .module-card {
        padding: 1.25rem 1.1rem;
        gap: 1rem;
    }
}

.module-card:hover {
    transform: translateY(-1px);
    border-color: rgba(17, 24, 39, .10);
    box-shadow: var(--tbz-shadow-float);
    color: var(--tbz-text-dark);
}

.module-card .mc-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #f3f4f6;
    border: 1px solid #eceff3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: none;
}

@media (min-width: 576px) {
    .module-card .mc-icon {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }
}

.module-card .mc-label {
    font-size: .7rem;
    color: #5a6272;
    margin-bottom: .1rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.module-card .mc-name {
    font-weight: 700;
    font-size: .95rem;
}

@media (min-width: 576px) {
    .module-card .mc-name {
        font-size: 1rem;
    }
}

/* Card background variants */
.mc-green {
    --mc-accent: var(--tbz-primary);
    --mc-bg1: #e7f7ea;
    --mc-bg2: #c9efcf;
}

.mc-gold {
    --mc-accent: var(--tbz-gold);
    --mc-bg1: #fff1cc;
    --mc-bg2: #ffe0a6;
}

.mc-teal {
    --mc-accent: var(--tbz-mc-teal-icon);
    --mc-bg1: #dafaf4;
    --mc-bg2: #baf1e7;
}

.mc-blue {
    --mc-accent: var(--tbz-mc-blue-icon);
    --mc-bg1: #deefff;
    --mc-bg2: #c6e0ff;
}

.mc-orange {
    --mc-accent: var(--tbz-mc-orange-icon);
    --mc-bg1: #ffe2d7;
    --mc-bg2: #ffd0c0;
}

.mc-amber {
    --mc-accent: var(--tbz-mc-amber-icon);
    --mc-bg1: #fff1d7;
    --mc-bg2: #ffe0b3;
}

/* legacy */
.mc-purple {
    --mc-accent: var(--tbz-mc-purple-icon);
    --mc-bg1: #f0ebff;
    --mc-bg2: #dbd2ff;
}

/* Icon colour helpers */
.mc-icon-green {
    color: var(--tbz-mc-green-icon);
}

.mc-icon-gold {
    color: var(--tbz-mc-gold-icon);
}

.mc-icon-teal {
    color: var(--tbz-mc-teal-icon);
}

.mc-icon-blue {
    color: var(--tbz-mc-blue-icon);
}

.mc-icon-orange {
    color: var(--tbz-mc-orange-icon);
}

.mc-icon-amber {
    color: var(--tbz-mc-amber-icon);
}

.mc-icon-purple {
    color: var(--tbz-mc-purple-icon);
}

/* ── 9. Content Cards ─────────────────────────────────────── */
.content-card,
.tbz-main .card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--tbz-border);
    overflow: hidden;
    box-shadow: var(--tbz-shadow-card);
    position: relative;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.content-card:hover,
.tbz-main .card:hover {
    transform: translateY(-1px);
    box-shadow: var(--tbz-shadow-card-hover);
    border-color: rgba(17, 24, 39, .10);
}

.content-card.text-center {
    background: radial-gradient(120% 140% at 0% 0%, rgba(45, 106, 45, .08) 0%, rgba(255, 255, 255, 0) 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(200, 164, 21, .10) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.content-card .card-header,
.tbz-main .card>.card-header {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    padding: .85rem 1.1rem;
    font-weight: 600;
    font-size: .88rem;
    color: var(--tbz-text-dark);
}

.content-card .card-body,
.tbz-main .card>.card-body {
    padding: 1.1rem;
}

.tbz-main .card>.card-footer {
    background: #f7f9fb;
    border-top: 1px solid var(--tbz-border);
    padding: .75rem 1rem;
}

/* App-wide form refinement for authenticated templates */
.tbz-main form label:not(.form-check-label),
.tbz-main form .form-label {
    color: #64748b;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: .35rem;
    text-transform: uppercase;
}

.tbz-main .form-control,
.tbz-main .form-select,
.tbz-main form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]),
.tbz-main form select,
.tbz-main form textarea {
    background: #f8fafc;
    border: 1px solid #dbe4ed;
    border-radius: .75rem;
    color: var(--tbz-text-dark);
    font-size: .88rem;
    min-height: 42px;
}

.tbz-main form textarea {
    min-height: 100px;
}

.tbz-main .form-control:focus,
.tbz-main .form-select:focus,
.tbz-main form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):focus,
.tbz-main form select:focus,
.tbz-main form textarea:focus {
    background: #fff;
    border-color: var(--tbz-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 45, .12);
}

.tbz-main .form-control::placeholder,
.tbz-main form input::placeholder,
.tbz-main form textarea::placeholder {
    color: #94a3b8;
}

/* Reusable async search-select */
.tbz-search-select {
    position: relative;
}

.tbz-search-select-control {
    position: relative;
}

.tbz-search-select-input {
    padding-right: 2rem;
}

.tbz-search-select-clear {
    align-items: center;
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    height: 100%;
    justify-content: center;
    position: absolute;
    right: .45rem;
    top: 0;
    width: 1.25rem;
}

.tbz-search-select-clear:hover {
    color: #475569;
}

.tbz-search-select-dropdown {
    background: #fff;
    border: 1px solid var(--tbz-border);
    border-radius: .75rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .10);
    left: 0;
    margin-top: .35rem;
    max-height: 260px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1060;
}

.tbz-search-select-option {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    color: var(--tbz-text-dark);
    cursor: pointer;
    display: block;
    font-size: .86rem;
    padding: .58rem .7rem;
    text-align: left;
    width: 100%;
}

.tbz-search-select-option:last-child {
    border-bottom: 0;
}

.tbz-search-select-option:hover,
.tbz-search-select-option:focus {
    background: #f8fafc;
}

.tbz-search-select-empty {
    color: var(--tbz-text-muted);
    font-size: .82rem;
    padding: .6rem .7rem;
}

/* App-wide table refinement for authenticated templates */
.table-responsive,
.tbz-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-responsive>table,
.tbz-table-scroll>table,
.table-responsive>.table,
.tbz-table-scroll>.table {
    margin-bottom: 0;
}

.tbz-main .table-responsive,
.tbz-main .tbz-table-scroll {
    background: #fff;
    border: 1px solid var(--tbz-border);
    border-radius: 12px;
}

.tbz-main .table {
    margin-bottom: 0;
}

.tbz-main .table> :not(caption)>*>* {
    border-bottom: 1px solid #edf1f5;
    padding: .72rem .85rem;
    vertical-align: middle;
}

.tbz-main .table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.tbz-main .table-hover>tbody>tr:hover>* {
    background: #fbfdfb;
}

.tbz-work-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.tbz-chip {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--tbz-primary-light);
    color: var(--tbz-primary-hover);
    font-size: .72rem;
    font-weight: 600;
}

.tbz-field-label {
    display: block;
    margin-bottom: .35rem;
    font-size: .74rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.tbz-soft-input {
    background: #f8fafc !important;
    border: 1px solid #dbe4ed !important;
    border-radius: .75rem !important;
    min-height: 42px;
    font-size: .88rem !important;
}

.tbz-soft-input:focus {
    background: #fff !important;
    border-color: var(--tbz-primary) !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 45, .12) !important;
}

.tbz-data-table {
    margin-bottom: 0;
}

/* ── PWA: Offline / sync status banner ───────────────────── */
#tbz-offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: .55rem 1.25rem;
    text-align: center;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.4;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.tbz-offline-banner--offline {
    background: #fff4f4;
    color: #b91c1c;
    border-bottom-color: #fecaca;
}

.tbz-offline-banner--online {
    background: #f0fdf4;
    color: #166534;
    border-bottom-color: #bbf7d0;
}

.tbz-offline-banner--warning {
    background: #fffbeb;
    color: #92400e;
    border-bottom-color: #fde68a;
}

.tbz-offline-banner--success {
    background: var(--tbz-primary-light);
    color: var(--tbz-primary-hover);
    border-bottom-color: #6ee7b7;
}

.tbz-offline-banner--danger {
    background: #fff4f4;
    color: #b91c1c;
    border-bottom-color: #fecaca;
}

/* ── PWA: Update-available banner variant ────────────────── */
.tbz-offline-banner--update {
    background: #eff6ff;
    color: #1e40af;
    border-bottom-color: #bfdbfe;
}

/* Inline action button used inside banners (e.g. "Refresh now") */
.tbz-banner-action-btn {
    display: inline-flex;
    align-items: center;
    padding: .15rem .65rem;
    border: 1.5px solid currentColor;
    border-radius: .4rem;
    background: transparent;
    color: inherit;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    vertical-align: middle;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.tbz-banner-action-btn:hover {
    background: rgba(0, 0, 0, .08);
}

/* Inline link inside banners (e.g. "Sign in again") */
.tbz-banner-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tbz-banner-link:hover {
    opacity: .8;
}

/* ── PWA: Install App button (topbar) ────────────────────── */
#tbz-pwa-install-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    border: 1.5px solid var(--tbz-primary);
    border-radius: .55rem;
    background: transparent;
    color: var(--tbz-primary);
    font-size: .74rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

#tbz-pwa-install-btn:hover,
#tbz-pwa-install-btn:focus-visible {
    background: var(--tbz-primary);
    color: #fff;
    outline: none;
}

.tbz-data-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--tbz-border);
    color: #64748b;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    padding: .75rem .85rem;
    text-transform: uppercase;
}

.tbz-data-table tbody td {
    border-bottom: 1px solid #edf1f5;
    font-size: .86rem;
    padding: .7rem .85rem;
    vertical-align: middle;
}

.tbz-data-table tbody tr:last-child td {
    border-bottom: none;
}

.tbz-data-table tbody tr:hover {
    background: #fbfdfb;
}

.tbz-metric-list {
    display: grid;
    gap: .55rem;
}

.tbz-metric-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    font-size: .84rem;
    justify-content: space-between;
    padding: .55rem .7rem;
}

.tbz-metric-row .value {
    color: var(--tbz-text-dark);
    font-weight: 700;
}

/* ── 10. Progress Bar ─────────────────────────────────────── */
.tbz-quota-progress {
    height: 5px;
    border-radius: 4px;
}

.tbz-quota-bar {
    background: var(--tbz-primary);
}

/* ── 11. Badge helpers ────────────────────────────────────── */
.badge-status-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-status-active,
.badge-status-verified,
.badge-status-approved {
    background: #d1e7dd;
    color: #0a3622;
}

.badge-status-suspended,
.badge-status-rejected,
.badge-status-cancelled,
.badge-status-expired {
    background: #f8d7da;
    color: #58151c;
}

.badge-status-issued,
.badge-status-arrived {
    background: #d1e7dd;
    color: #0a3622;
}

.badge-status-in_transit {
    background: #cfe2ff;
    color: #084298;
}

.tbz-badge-primary {
    background: var(--tbz-primary) !important;
    color: #fff;
}

/* ── 12. Alert helpers ────────────────────────────────────── */
.tbz-alert-warning {
    background: var(--tbz-gold-light);
    color: #856404;
    border: 0;
}

/* Inline link inside a warning alert container */
.tbz-alert-warning a {
    color: #856404;
    font-weight: 600;
    text-decoration: none;
}

.tbz-alert-info {
    background: var(--tbz-primary-light);
    color: var(--tbz-primary-hover);
    border: 0;
}

.tbz-alert-error {
    background: #fce8e1;
    color: #c0392b;
    border: 0;
}

/* ── 13. Buttons — green + gold palette ───────────────────── */
.btn-primary {
    background: var(--tbz-primary);
    border-color: var(--tbz-primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--tbz-primary-hover);
    border-color: var(--tbz-primary-hover);
    color: #fff;
}

.btn-outline-primary {
    color: var(--tbz-primary);
    border-color: var(--tbz-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--tbz-primary);
    border-color: var(--tbz-primary);
    color: #fff;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
}

.btn-sm {
    border-radius: 10px;
}

/* Link helper */
.tbz-link-primary {
    color: var(--tbz-primary);
    text-decoration: none;
}

.tbz-link-primary:hover {
    color: var(--tbz-primary-hover);
}

/* ── 14. Tables ───────────────────────────────────────────── */
.table {
    font-size: .875rem;
}

.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tbz-text-muted);
    border-bottom-width: 1px;
}

@media (max-width: 767.98px) {

    .table-responsive,
    .tbz-table-scroll {
        scrollbar-width: thin;
    }
}

/* ── 15. Anonymous Navbar ─────────────────────────────────── */
.tbz-anon-nav {
    background: #fff;
    border-bottom: 1px solid var(--tbz-border);
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 576px) {
    .tbz-anon-nav {
        padding: .75rem 1.5rem;
    }
}

.tbz-anon-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--tbz-text-dark);
    text-decoration: none;
}

.tbz-anon-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--tbz-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tbz-gold);
    font-size: 1rem;
}

/* ── 16. Auth Pages (Login / Register) ───────────────────── */
.tbz-auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    overflow: hidden;
    border: 0;
}

.tbz-auth-card--wide {
    max-width: 480px;
}

.tbz-auth-logo-icon {
    width: 60px;
    height: 60px;
    background: var(--tbz-primary);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .75rem;
}

.tbz-auth-logo-icon i {
    color: var(--tbz-gold);
    font-size: 1.8rem;
}

.tbz-form-control {
    background: var(--tbz-body-bg) !important;
    border: 1px solid var(--tbz-border) !important;
    border-radius: .5rem !important;
    padding: .7rem 1rem !important;
    font-size: .9rem;
}

.tbz-form-control:focus {
    background: var(--tbz-primary-light) !important;
    border-color: var(--tbz-primary) !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 45, .15) !important;
    outline: none;
}

/* Django-rendered form fields inside auth card */
.tbz-auth-card input[type=text],
.tbz-auth-card input[type=email],
.tbz-auth-card input[type=password],
.tbz-auth-card select {
    display: block;
    width: 100%;
    padding: .7rem 1rem;
    background: var(--tbz-body-bg);
    border: 1px solid var(--tbz-border);
    border-radius: .5rem;
    font-size: .9rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.tbz-auth-card input[type=text]:focus,
.tbz-auth-card input[type=email]:focus,
.tbz-auth-card input[type=password]:focus,
.tbz-auth-card select:focus {
    background: var(--tbz-primary-light);
    border-color: var(--tbz-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 45, .15);
}

.tbz-auth-link {
    color: var(--tbz-primary);
    font-weight: 600;
    text-decoration: none;
}

.tbz-auth-link:hover {
    color: var(--tbz-primary-hover);
}

.tbz-label {
    font-size: .875rem;
    font-weight: 600;
    color: #4a5568;
}

/* Split auth layout */
.tbz-auth-body {
    background: #e9e9ea;
    min-height: 100vh;
}

.tbz-auth-layout {
    min-height: 100vh;
    display: flex;
}

.tbz-auth-branding {
    display: none;
    width: 50%;
    background:
        linear-gradient(rgba(17, 64, 38, .58), rgba(17, 64, 38, .58)),
        url('../images/tobacco_background.jpg') center/cover no-repeat;
    color: #ffffff;
    padding: 3rem 2.5rem;
    flex-direction: column;
    justify-content: space-between;
}

.tbz-auth-brand-top {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.tbz-auth-brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.tbz-auth-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.tbz-auth-brand-copy h1 {
    font-size: clamp(2rem, 2.6vw, 3rem);
    line-height: 1.2;
    margin-bottom: 1rem;
    max-width: 640px;
}

.tbz-auth-brand-copy p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, .82);
    max-width: 500px;
}

.tbz-auth-brand-foot {
    font-size: .92rem;
    color: rgba(255, 255, 255, .6);
    margin: 0;
}

.tbz-auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.tbz-auth-form-slot {
    width: 100%;
    max-width: 500px;
}

.tbz-auth-main .tbz-auth-card {
    max-width: 100%;
    border-radius: 14px;
    background: #f4f4f4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08) !important;
}

.tbz-auth-main .tbz-auth-card.tbz-auth-card--wide {
    max-width: 100%;
}

.tbz-auth-mobile-brand {
    display: block;
    text-align: center;
    margin-bottom: 1.75rem;
}

.tbz-auth-mobile-logo-wrap {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    margin-bottom: .7rem;
}

.tbz-auth-mobile-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.tbz-auth-mobile-brand h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.tbz-auth-mobile-foot {
    margin-top: 1rem;
    color: #606773;
    font-size: .95rem;
}

.tbz-auth-input-wrap {
    position: relative;
}

.tbz-auth-input-wrap>i {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #2b2b2b;
    font-size: 1rem;
    z-index: 2;
}

.tbz-auth-input-wrap input,
.tbz-auth-input-wrap select,
.tbz-auth-input-wrap textarea,
.tbz-auth-input-wrap .form-control,
.tbz-auth-input-wrap .form-select {
    padding-left: 2.3rem !important;
}

.tbz-auth-eye {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #2b2b2b;
    padding: .2rem .35rem;
    border-radius: .35rem;
    line-height: 1;
}

.tbz-auth-eye:hover {
    background: rgba(15, 157, 107, .12);
}

.tbz-auth-main .btn-primary {
    background: var(--tbz-primary);
    border-color: var(--tbz-primary);
}

.tbz-auth-main .btn-primary:hover,
.tbz-auth-main .btn-primary:focus {
    background: var(--tbz-primary-hover);
    border-color: var(--tbz-primary-hover);
}

.tbz-auth-main .tbz-auth-link {
    color: var(--tbz-primary);
}

.tbz-auth-main .tbz-auth-link:hover {
    color: var(--tbz-primary-hover);
}

.tbz-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tbz-auth-card .tbz-auth-btn {
    width: 100%;
    min-height: 46px;
    border-radius: .65rem;
    font-weight: 600;
    padding: .62rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

.tbz-auth-card .tbz-auth-btn-row {
    display: flex;
    gap: .55rem;
}

.tbz-auth-card .tbz-auth-btn-row .tbz-auth-btn {
    width: 50%;
}

.tbz-auth-footer {
    text-align: center;
    margin-top: 1.1rem;
}

.tbz-auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbz-auth-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #c9ced5;
    color: #8a94a6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    background: #fff;
}

.tbz-auth-step.active,
.tbz-auth-step.completed {
    background: var(--tbz-primary);
    border-color: var(--tbz-primary);
    color: #fff;
}

.tbz-auth-step-line {
    width: 42px;
    height: 2px;
    background: #c9ced5;
    margin: 0 .45rem;
}

.tbz-auth-note {
    display: flex;
    gap: .55rem;
    align-items: center;
    background: #eaf7f2;
    color: var(--tbz-primary-hover);
    border: 1px solid #c5eadc;
    border-radius: 10px;
    padding: .7rem .8rem;
    font-size: .86rem;
}

@media (min-width: 992px) {
    .tbz-auth-branding {
        display: flex;
        width: 44%;
    }

    .tbz-auth-layout--staff .tbz-auth-branding {
        width: 50%;
    }

    .tbz-auth-main {
        width: 56%;
    }

    .tbz-auth-layout--staff .tbz-auth-main {
        width: 50%;
    }

    .tbz-auth-mobile-brand,
    .tbz-auth-mobile-foot {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .tbz-auth-main {
        padding: 1.25rem .9rem;
    }

    .tbz-auth-mobile-brand h2 {
        font-size: 1.1rem;
    }

    .tbz-auth-main .tbz-auth-card {
        border-radius: 12px;
    }

    .tbz-auth-step-line {
        width: 30px;
        margin: 0 .35rem;
    }

    .tbz-auth-card .tbz-auth-btn-row {
        flex-direction: column;
    }

    .tbz-auth-card .tbz-auth-btn-row .tbz-auth-btn {
        width: 100%;
    }
}

/* ── 17. Form controls (global) ───────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--tbz-primary);
    box-shadow: 0 0 0 .2rem rgba(45, 106, 45, .2);
}

/* Generic Django form controls rendered without Bootstrap classes */
.tbz-content form input[type=text],
.tbz-content form input[type=email],
.tbz-content form input[type=number],
.tbz-content form input[type=date],
.tbz-content form input[type=time],
.tbz-content form input[type=datetime-local],
.tbz-content form input[type=password],
.tbz-content form textarea,
.tbz-content form select {
    width: 100%;
    border: 1px solid var(--tbz-border);
    border-radius: .5rem;
    padding: .6rem .8rem;
    background: #fff;
    color: var(--tbz-text-dark);
    font-size: .9rem;
}

.tbz-content form input[type=text]:focus,
.tbz-content form input[type=email]:focus,
.tbz-content form input[type=number]:focus,
.tbz-content form input[type=date]:focus,
.tbz-content form input[type=time]:focus,
.tbz-content form input[type=datetime-local]:focus,
.tbz-content form input[type=password]:focus,
.tbz-content form textarea:focus,
.tbz-content form select:focus {
    border-color: var(--tbz-primary);
    box-shadow: 0 0 0 .2rem rgba(45, 106, 45, .16);
    outline: none;
}

/* Bootstrap 5 applies appearance:none to .form-control which suppresses the
   native clock/calendar picker indicator in Chromium. Restore it for all
   date and time inputs sitewide so the native picker opens on click. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    display: block;
}

/* ── 18. Page + panel helpers ─────────────────────────────── */
.tbz-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tbz-page-title-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.tbz-page-title-row i {
    color: var(--tbz-primary);
}

.tbz-page-subtitle {
    margin: .15rem 0 0;
    color: var(--tbz-text-muted);
    font-size: .84rem;
}

.tbz-hero-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .tbz-hero-title {
        font-size: 1.9rem;
    }
}

.tbz-hero-sub {
    margin: .35rem 0 0;
    color: var(--tbz-text-muted);
    font-size: .9rem;
}

.tbz-kpi-card {
    background: #fff;
    border: 1px solid var(--tbz-border);
    border-radius: 14px;
    box-shadow: var(--tbz-shadow-card);
    padding: 1rem 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.tbz-kpi-card--accent {
    background: var(--tbz-primary-light);
    border-color: #d3efe3;
}

.tbz-kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.tbz-kpi-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--tbz-text-muted);
}

.tbz-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #eceff3;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    flex: 0 0 auto;
}

.tbz-kpi-card--accent .tbz-kpi-icon {
    background: #bfead9;
    border-color: #bfead9;
    color: var(--tbz-primary);
}

.tbz-kpi-value {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.tbz-kpi-sub {
    font-size: .82rem;
    color: var(--tbz-text-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.tbz-kpi-sub strong {
    color: var(--tbz-text-dark);
    font-weight: 600;
}

.tbz-form-panel {
    background: #fff;
    border: 1px solid var(--tbz-border);
    border-radius: 14px;
    padding: 1rem;
}

.tbz-settings-grid .content-card {
    overflow: hidden;
}

.tbz-settings-header {
    border-bottom: 1px solid var(--tbz-border);
}

.tbz-settings-title {
    align-items: center;
    color: var(--tbz-text-dark);
    display: inline-flex;
    font-size: .95rem;
    font-weight: 700;
    gap: .25rem;
}

.tbz-settings-muted {
    color: var(--tbz-text-muted);
    font-size: .8rem;
    margin-top: .15rem;
}

.tbz-settings-form {
    border-style: dashed;
}

.tbz-settings-stat .card-body {
    align-items: center;
    display: flex;
    gap: .9rem;
}

.tbz-settings-stat-icon {
    align-items: center;
    background: #f4f7fb;
    border: 1px solid #e3e8ef;
    border-radius: 12px;
    display: inline-flex;
    font-size: 1.1rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.tbz-settings-stat-label {
    color: var(--tbz-text-muted);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.tbz-settings-stat-value {
    color: var(--tbz-text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.tbz-settings-stat-sub {
    color: var(--tbz-text-muted);
    font-size: .78rem;
    margin-top: .2rem;
}

.tbz-field-wrap {
    position: relative;
}

.tbz-field-wrap .tbz-field-icon {
    color: #94a3b8;
    left: .7rem;
    line-height: 1;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.tbz-field-wrap .form-control,
.tbz-field-wrap .form-select,
.tbz-field-wrap input,
.tbz-field-wrap select,
.tbz-field-wrap textarea {
    padding-left: 2.1rem !important;
}

.tbz-settings-security-row {
    align-items: center;
    border-bottom: 1px dashed #e6ebf1;
    display: flex;
    justify-content: space-between;
    padding-bottom: .5rem;
}

.tbz-settings-security-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.tbz-settings-security-label {
    color: var(--tbz-text-dark);
    font-size: .85rem;
    font-weight: 600;
}

.tbz-2fa-setup-box {
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    padding: .8rem;
}

.tbz-2fa-qr-wrap {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    padding: .6rem;
}

.tbz-2fa-qr-wrap img {
    height: auto;
    max-width: 220px;
    width: 100%;
}

.tbz-2fa-secret {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--tbz-text-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .8rem;
    overflow-wrap: anywhere;
    padding: .5rem .6rem;
}

.tbz-password-field {
    position: relative;
}

.tbz-password-field .form-control {
    padding-left: 2.1rem;
    padding-right: 2.2rem;
}

.tbz-password-icon {
    color: #94a3b8;
    left: .7rem;
    line-height: 1;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.tbz-password-eye {
    align-items: center;
    background: transparent;
    border: 0;
    color: #64748b;
    display: inline-flex;
    height: 100%;
    justify-content: center;
    position: absolute;
    right: .4rem;
    top: 0;
    width: 1.8rem;
}

.tbz-password-eye:hover {
    color: var(--tbz-primary-hover);
}

.tbz-password-eye:focus {
    outline: none;
}

.tbz-password-policy ul {
    margin: 0;
    padding-left: 1.1rem;
}

.tbz-password-policy li {
    color: var(--tbz-text-muted);
    font-size: .82rem;
    margin-bottom: .3rem;
}

.tbz-password-tips {
    margin: 0;
    padding-left: 1.05rem;
}

.tbz-password-tips li {
    color: var(--tbz-text-muted);
    font-size: .82rem;
    margin-bottom: .35rem;
}

.tbz-table-wrap {
    overflow-x: auto;
}

.tbz-empty {
    color: var(--tbz-text-muted);
    text-align: center;
    padding: 1rem;
}

.tbz-metric {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: var(--tbz-primary-light);
    color: var(--tbz-primary-hover);
    font-size: .74rem;
    font-weight: 600;
}

.tbz-metric i {
    font-size: .8rem;
}

.tbz-inline-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.tbz-pagination {
    display: flex;
    justify-content: flex-end;
    padding: .8rem 1rem;
    border-top: 1px solid var(--tbz-border);
    background: #fff;
}

.tbz-filter-pills {
    gap: .4rem;
}

.tbz-filter-pills .nav-link,
.tbz-filter-pills .tbz-filter-pill {
    background: #fff;
    border: 1px solid #c9dfc9;
    border-radius: .55rem;
    color: var(--tbz-primary);
    display: inline-flex;
    font-weight: 600;
    padding: .42rem .8rem;
    text-decoration: none;
}

.tbz-filter-pills .nav-link:hover,
.tbz-filter-pills .nav-link:focus,
.tbz-filter-pills .tbz-filter-pill:hover,
.tbz-filter-pills .tbz-filter-pill:focus {
    background: var(--tbz-primary-light);
    border-color: var(--tbz-primary);
    color: var(--tbz-primary-hover);
}

.tbz-filter-pills .nav-link.active,
.tbz-filter-pills .show>.nav-link,
.tbz-filter-pills .tbz-filter-pill.active {
    background: var(--tbz-primary);
    border-color: var(--tbz-primary);
    color: var(--tbz-gold);
}

.tbz-filter-pills .nav-link.active:hover,
.tbz-filter-pills .show>.nav-link:hover,
.tbz-filter-pills .tbz-filter-pill.active:hover {
    background: var(--tbz-primary-hover);
    border-color: var(--tbz-primary-hover);
    color: var(--tbz-gold);
}

.tbz-notif-filter-pills .tbz-filter-pill {
    gap: 0.35rem;
}

.tbz-notif-filter-pills .tbz-notif-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 0.1rem;
    background: rgba(15, 138, 95, 0.15);
    color: var(--tbz-primary);
}

.tbz-notif-filter-pills .tbz-notif-filter-count--muted {
    background: #e5e7eb;
    color: var(--tbz-text-dark);
}

.tbz-notif-filter-pills .tbz-filter-pill.active .tbz-notif-filter-count,
.tbz-notif-filter-pills .tbz-filter-pill.active .tbz-notif-filter-count--muted {
    background: rgba(255, 255, 255, 0.25);
    color: var(--tbz-gold);
}

/* ── 19. Crop Seasons ─────────────────────────────────────── */
.tbz-season-card {
    background: #fff;
    border: 1px solid var(--tbz-border);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
    display: flex;
    flex-direction: column;
    gap: .95rem;
    height: 100%;
    padding: 1rem;
}

.tbz-season-card.is-active {
    border-color: rgba(45, 106, 45, .4);
    box-shadow: 0 0 0 1px rgba(45, 106, 45, .12), 0 10px 22px rgba(15, 23, 42, .06);
}

.tbz-season-card-head {
    align-items: flex-start;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.tbz-season-card-title {
    color: var(--tbz-text-dark);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
}

.tbz-season-card-subtitle {
    color: #334155;
    font-size: .98rem;
    margin: .3rem 0 0;
}

.tbz-season-card-icon {
    align-items: center;
    background: var(--tbz-primary-light);
    border-radius: 10px;
    color: var(--tbz-primary);
    display: inline-flex;
    font-size: 1rem;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.tbz-season-status {
    background: var(--tbz-primary);
    border-radius: 999px;
    color: var(--tbz-gold);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    padding: .28rem .62rem;
}

.tbz-season-periods {
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    gap: .9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: .85rem 0;
}

.tbz-season-label {
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: .2rem;
    text-transform: uppercase;
}

.tbz-season-value {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 600;
}

.tbz-season-actions {
    align-items: center;
    display: flex;
    gap: .55rem;
    justify-content: space-between;
}

.tbz-season-set-btn {
    min-width: 140px;
}

#season-form .form-check-input {
    border-color: #b6c3d1;
}

#season-form .form-check-input:checked {
    background-color: var(--tbz-primary);
    border-color: var(--tbz-primary);
}

@media (max-width: 575.98px) {
    .tbz-season-card-title {
        font-size: 1.35rem;
    }

    .tbz-season-periods {
        grid-template-columns: 1fr;
    }

    .tbz-season-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ── 20. Reusable Wizard ─────────────────────────────────── */
.tbz-wizard-shell,
.tbz-reg-shell {
    display: grid;
    gap: .75rem;
}

.tbz-wizard-header,
.tbz-reg-header {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.tbz-wizard-title,
.tbz-reg-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.tbz-wizard-subtitle,
.tbz-reg-subtitle {
    color: var(--tbz-text-muted);
    font-size: .86rem;
}

.tbz-wizard-stepper,
.tbz-reg-stepper {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tbz-wizard-step,
.tbz-reg-step {
    align-items: center;
    background: #fff;
    border: 1px solid #dbe4ed;
    border-radius: 10px;
    color: #64748b;
    display: flex;
    gap: .5rem;
    min-height: 42px;
    padding: .45rem .6rem;
}

.tbz-wizard-step .index,
.tbz-reg-step .index {
    align-items: center;
    background: #e2e8f0;
    border-radius: 999px;
    color: #475569;
    display: inline-flex;
    font-size: .75rem;
    font-weight: 700;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.tbz-wizard-step .label,
.tbz-reg-step .label {
    font-size: .8rem;
    font-weight: 600;
}

.tbz-wizard-step.is-active,
.tbz-reg-step.is-active {
    background: var(--tbz-primary-light);
    border-color: #c9dfc9;
    color: var(--tbz-primary-hover);
}

.tbz-wizard-step.is-active .index,
.tbz-reg-step.is-active .index {
    background: var(--tbz-primary);
    color: #fff;
}

.tbz-wizard-progress,
.tbz-reg-progress {
    background: #e2e8f0;
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

.tbz-wizard-card .card-header,
.tbz-reg-card .card-header {
    display: grid;
    gap: .2rem;
}

.tbz-wizard-card-title,
.tbz-reg-card-title {
    color: var(--tbz-text-dark);
    font-size: .96rem;
    font-weight: 700;
}

.tbz-wizard-card-subtitle,
.tbz-reg-card-subtitle {
    color: var(--tbz-text-muted);
    font-size: .8rem;
    font-weight: 500;
}

.tbz-wizard-actions,
.tbz-reg-actions {
    border-top: 1px solid var(--tbz-border);
    display: flex;
    justify-content: space-between;
    margin-top: .35rem;
    padding-top: .9rem;
}

/* ── 21. Responsive utilities ─────────────────────────────── */

/* Stack module card row to 1 column on xs, 2 on sm, 4 on xl */
/* (Bootstrap grid handles this via col- classes) */

@media (max-width: 767.98px) {

    .tbz-wizard-stepper,
    .tbz-reg-stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Compact content padding on xs */
@media (max-width: 575.98px) {
    .tbz-breadcrumb-bar {
        margin-bottom: .75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .sc-value {
        font-size: 1.35rem;
    }

    .content-card .card-header {
        padding: .75rem 1rem;
    }

    .content-card .card-body {
        padding: 1rem;
    }

    .tbz-wizard-header,
    .tbz-reg-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tbz-wizard-actions,
    .tbz-reg-actions {
        flex-direction: column-reverse;
    }

    .tbz-wizard-actions .btn,
    .tbz-reg-actions .btn {
        width: 100%;
    }

    .tbz-settings-stat .card-body {
        align-items: flex-start;
    }
}

/* ── 22. Ticket Barcode Scanner ─────────────────────────────── */

.tbz-scanner-viewport {
    align-items: center;
    background: #121926;
    border: 1px dashed #3b4b68;
    border-radius: .75rem;
    display: flex;
    justify-content: center;
    min-height: 220px;
    overflow: hidden;
}

.tbz-scanner-viewport .js-scan-video {
    max-height: 320px;
    object-fit: cover;
    width: 100%;
}

/* ── 23. Sales Floor Capture Workflow ───────────────────────── */

/* Completed step variant (previously-done steps) */
.tbz-capture-step-done {
    background: #f0fdf4;
    border-color: #c9dfc9;
    color: #276749;
}

.tbz-capture-step-done .index {
    background: #276749;
    color: #d1e7dd;
}

/* Live activity pulse dot */
.tbz-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: tbz-pulse-live 1.4s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes tbz-pulse-live {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .25;
    }
}

/* Capture form section divider */
.tbz-capture-section-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tbz-text-muted);
    padding: .5rem 0 .35rem;
    border-bottom: 1px solid var(--tbz-border);
    margin-bottom: .85rem;
}

/* Result card accent borders */
.tbz-result-success {
    border-left: 4px solid #198754;
}

.tbz-result-error {
    border-left: 4px solid #dc3545;
}

/* Extra-small badge text (for inline labels inside headers) */
.tbz-badge-xs {
    font-size: .62rem;
    padding: .15rem .4rem;
    border-radius: .35rem;
}

/* Informational block (e.g. settlement notice, inline hints) */
.tbz-info-block {
    background: var(--tbz-primary-light);
    border-radius: .6rem;
    color: var(--tbz-primary-hover);
    padding: .75rem 1rem;
    font-size: .84rem;
}

/* Grower auto-fill info panel on inspection create form */
.tbz-grower-info-panel {
    background: var(--tbz-primary-light);
    border: 1px solid #c9dfc9;
}

/* ── Grower Detail page (gd-) ───────────────────────────────────── */
.gd-hero {
    border: 1px solid #dcefe4;
    background: linear-gradient(135deg, #f6fffa 0%, #ffffff 60%, #eefbf4 100%);
}

.gd-avatar {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9f7ef;
    border: 1px solid #ccebd8;
    color: var(--tbz-primary);
    font-size: 1.45rem;
    flex-shrink: 0;
    overflow: hidden;
}

.gd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.gd-side {
    position: sticky;
    top: 84px;
}

.gd-doc-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .55rem .7rem;
    border: 1px solid var(--tbz-border);
    border-radius: .55rem;
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.gd-doc-link:hover {
    border-color: #b8d9c6;
    background: var(--tbz-primary-light);
}

.gd-crop-table th,
.gd-crop-table td {
    white-space: nowrap;
}

.gd-crop-table .gd-wrap {
    white-space: normal;
}

.gd-table-note {
    background: var(--tbz-body-bg);
    border-top: 1px solid var(--tbz-border);
    color: var(--tbz-text-muted);
    font-size: .82rem;
}

@media (max-width: 991.98px) {
    .gd-side {
        position: static;
    }
}

/* ── Grower Approve page (ga-) ──────────────────────────────────── */
.ga-hero {
    border: 1px solid #dcefe4;
    background: linear-gradient(135deg, #f6fffa 0%, #ffffff 60%, #eefbf4 100%);
}

.ga-avatar {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9f7ef;
    border: 1px solid #ccebd8;
    color: var(--tbz-primary);
    font-size: 1.45rem;
    flex-shrink: 0;
    overflow: hidden;
}

.ga-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.ga-side {
    position: sticky;
    top: 84px;
}

.ga-checklist-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem 0;
    font-size: .875rem;
    border-bottom: 1px solid var(--tbz-border);
}

.ga-checklist-item:last-child {
    border-bottom: none;
}

.ga-check-ok {
    color: var(--tbz-primary);
}

.ga-check-warn {
    color: #dc3545;
}

.ga-doc-card {
    border: 1px solid var(--tbz-border);
    border-radius: .6rem;
    overflow: hidden;
    background: #fff;
}

.ga-doc-img-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--tbz-primary-light);
}

.ga-doc-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform .2s ease;
}

.ga-doc-img-wrap:hover img {
    transform: scale(1.04);
}

.ga-doc-label {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .4rem .6rem;
    font-size: .78rem;
    border-top: 1px solid var(--tbz-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 991.98px) {
    .ga-side {
        position: static;
    }
}

/* ── Reusable file-upload drop zone ─────────────────────────── */
.tbz-file-drop {
    border: 2px dashed var(--tbz-border);
    border-radius: .75rem;
    background: var(--tbz-bg);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}

.tbz-file-drop:hover,
.tbz-file-drop.is-dragover {
    border-color: var(--tbz-primary);
    background: var(--tbz-primary-light);
}

.tbz-file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.tbz-file-drop .tbz-file-drop-icon {
    font-size: 2.2rem;
    color: var(--tbz-primary);
    display: block;
    margin-bottom: .5rem;
}

.tbz-file-drop .tbz-file-drop-label {
    font-weight: 600;
    color: var(--tbz-text);
}

.tbz-file-drop .tbz-file-drop-hint {
    font-size: .8rem;
    color: var(--tbz-muted);
    margin-top: .25rem;
}

.tbz-file-drop-preview {
    display: none;
    align-items: center;
    gap: .75rem;
    background: var(--tbz-primary-light);
    border: 1px solid #c9dfc9;
    border-radius: .6rem;
    padding: .6rem .9rem;
    margin-top: .75rem;
    font-size: .85rem;
}

.tbz-file-drop-preview.is-visible {
    display: flex;
}

.tbz-file-drop-preview .tbz-file-name {
    font-weight: 600;
    color: var(--tbz-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tbz-file-drop-preview .tbz-file-size {
    color: var(--tbz-muted);
    white-space: nowrap;
}

.tbz-file-drop-preview .btn-tbz-clear {
    border: none;
    background: none;
    color: var(--tbz-muted);
    padding: 0 .25rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.tbz-file-drop-preview .btn-tbz-clear:hover {
    color: #dc3545;
}

/* ── Document Image Cards (profile photo / ID uploads) ─────────── */
.tbz-doc-card {
    border: 1px solid var(--tbz-border);
    border-radius: .75rem;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.tbz-doc-card__preview {
    height: 180px;
    background: #f4f7f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.tbz-doc-card__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.tbz-doc-card__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    color: #aab8b0;
    font-size: .82rem;
}

.tbz-doc-card__placeholder i {
    font-size: 2.2rem;
}

.tbz-doc-card__footer {
    padding: .6rem .75rem;
    border-top: 1px solid var(--tbz-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    background: #fafcfb;
}

.tbz-doc-card__label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--tbz-text-muted, #6c757d);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbz-doc-card__badge {
    font-size: .72rem;
    background: #e6f4ec;
    color: #0f8a5f;
    border: 1px solid #c3e6cb;
    border-radius: .35rem;
    padding: .15rem .45rem;
    white-space: nowrap;
}

/* ── Crop Information: Season Cards ───────────────────────────── */
.tbz-season-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d6a2d;
    padding: .5rem 0 .25rem;
    letter-spacing: .02em;
}

.tbz-season-divider {
    height: 3px;
    background: linear-gradient(90deg, #2d6a2d 60%, transparent);
    margin-bottom: .75rem;
    border-radius: 2px;
}

.tbz-crop-label {
    background: #f8f9fa;
    font-weight: 600;
    font-size: .82rem;
    white-space: nowrap;
    min-width: 90px;
}

.tbz-season-quota-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .5rem 0;
    margin-top: .25rem;
}

.tbz-quota-pill {
    display: inline-block;
    padding: .35rem .75rem;
    border-radius: 4px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.tbz-quota-total {
    background: #c8a415;
    color: #fff;
}

.tbz-quota-remaining {
    background: #1a73e8;
    color: #fff;
}

/* ── Pagination (Modern) ───────────────────────────────────── */
.tbz-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .9rem 0;
}

.content-card>.tbz-pagination,
.card-body>.tbz-pagination {
    border-top: 1px solid var(--tbz-border);
    margin-top: .15rem;
    padding: .9rem 1rem;
}

.tbz-pagination-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--tbz-text-muted);
    font-size: .82rem;
}

.tbz-pagination-page {
    font-weight: 600;
    color: #344054;
}

.tbz-pagination-total {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.tbz-pagination-total::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #c1c7d0;
}

.tbz-pagination .pagination {
    gap: .35rem;
}

.tbz-pagination .page-item .page-link,
.card-footer .page-item .page-link {
    min-width: 2.05rem;
    height: 2.05rem;
    border-radius: .65rem;
    border: 1px solid #e7eaf0;
    background: #fff;
    color: #475467;
    padding: 0 .62rem;
    font-size: .8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
}

.tbz-pagination .page-item .page-link:hover,
.card-footer .page-item .page-link:hover {
    border-color: #cfd6e3;
    color: var(--tbz-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 24, 40, .08);
}

.tbz-pagination .page-item.active .page-link,
.card-footer .page-item.active .page-link {
    background: var(--tbz-primary);
    color: #fff;
    border-color: var(--tbz-primary);
    box-shadow: 0 8px 16px rgba(15, 138, 95, .22);
}

.tbz-pagination .page-item.disabled .page-link,
.card-footer .page-item.disabled .page-link {
    color: #98a2b3;
    background: #f9fafb;
    border-color: #edf0f5;
    box-shadow: none;
    transform: none;
}

.tbz-pagination .page-link:focus,
.card-footer .page-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 138, 95, .16);
}

@media (max-width: 576px) {
    .tbz-pagination {
        justify-content: center;
    }

    .tbz-pagination-meta {
        width: 100%;
        justify-content: center;
    }

    .tbz-pagination .page-item .page-link {
        min-width: 1.9rem;
        height: 1.9rem;
        font-size: .77rem;
        padding: 0 .5rem;
    }
}

/* Sales floor capture wizard */
.sales-capture-wizard .tbz-wizard-header {
    margin-bottom: 1rem;
}

.sales-capture-wizard .tbz-wizard-step-text {
    color: var(--bs-secondary-color, #6c757d);
    font-size: .9rem;
}

.sales-capture-wizard .tbz-wizard-stepper {
    margin-bottom: 1rem;
}

.sales-capture-wizard .tbz-wizard-step {
    transition: all .18s ease;
    border-radius: .75rem;
    padding: .35rem .65rem;
}

.sales-capture-wizard .tbz-wizard-step.is-active {
    background: rgba(25, 135, 84, .08);
}

.sales-capture-wizard .wizard-panel {
    border: 1px solid rgba(15, 23, 42, .06);
    box-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .06);
}

.sales-capture-wizard .tbz-wizard-actions {
    gap: .5rem;
}

.sales-capture-wizard .tbz-wizard-actions .btn {
    min-width: 10rem;
}

/* Inline QR scan button — matches tbz-soft-input shape */
.tbz-scan-inline-btn {
    border-radius: .75rem;
    border-color: #dbe4ed;
    min-height: 42px;
}

/* Group permit entry selector header */
.tbz-group-permit-header {
    background: rgba(255, 193, 7, .08);
}

/* Validated permit info card header */
.tbz-permit-validated-header {
    background: rgba(25, 135, 84, .07);
}

/* Micro-label above data values (uppercase, tight tracking) */
.tbz-data-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Secondary value beneath a data label */
.tbz-data-value-sm {
    font-size: .75rem;
}

/* Capture table — ticket number cell */
.tbz-capture-ticket-cell {
    font-size: .8rem;
}

/* Capture table — grower name cell (truncate on overflow) */
.tbz-capture-grower-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Bale scan modal video */
.tbz-scan-video {
    max-height: 360px;
    object-fit: cover;
    border-radius: .5rem;
}

/* ── Bale row card layout (mobile) ───────────────────────────── */
@media (max-width: 767.98px) {
    .sales-capture-wizard .bale-row {
        background: #fff;
        border: 1px solid var(--tbz-border);
        border-left: 3px solid var(--tbz-primary);
        border-radius: .75rem;
        box-shadow: 0 1px 4px rgba(16, 24, 40, .06);
        padding: .65rem .75rem .6rem;
        margin-bottom: .65rem;
    }

    .sales-capture-wizard #baleRows .bale-row:last-child {
        margin-bottom: 0;
    }

    .sales-capture-wizard .bale-row-header {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding-bottom: .45rem;
        margin-bottom: .45rem;
        border-bottom: 1px solid var(--tbz-border);
    }

    .sales-capture-wizard .bale-row-number {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        flex-shrink: 0;
    }

    .sales-capture-wizard .bale-seq {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 50%;
        background: var(--tbz-primary);
        color: #fff;
        font-size: .7rem;
        font-weight: 700;
        flex-shrink: 0;
        line-height: 1;
    }

    .sales-capture-wizard .bale-label {
        font-size: .7rem;
        font-weight: 600;
        color: var(--tbz-text-muted);
        text-transform: uppercase;
        letter-spacing: .06em;
    }

    /* "Add Bale Row" full-width, comfortable touch target */
    .tbz-add-bale-btn {
        width: 100%;
        padding-top: .55rem;
        padding-bottom: .55rem;
    }
}

@media (min-width: 768px) {
    .bale-row-header {
        display: none;
    }

    .tbz-add-bale-btn {
        width: auto;
    }
}

/* ── Notifications list (inbox-style) ───────────────────────── */
.tbz-notif-shell {
    width: 100%;
}

.tbz-notif-card {
    border-radius: 14px;
    border: 1px solid var(--tbz-border);
    box-shadow: var(--tbz-shadow-card);
    overflow: hidden;
    background: #fff;
}

.tbz-notif-card .card-body {
    background: #fff;
}

.tbz-notif-card__header {
    padding: 1.1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--tbz-border);
    background: #fff;
}

.tbz-notif-card__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.tbz-notif-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--tbz-text-dark);
}

.tbz-notif-card__title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: var(--tbz-primary-light);
    color: var(--tbz-primary);
    font-size: 1.05rem;
}

.tbz-notif-card__menu-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--tbz-border);
    background: #fff;
    color: var(--tbz-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tbz-notif-card__menu-btn:hover {
    background: #f3f4f6;
    color: var(--tbz-primary);
    border-color: rgba(15, 138, 95, 0.25);
}

.tbz-notif-card__sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.35rem;
}

.tbz-notif-detail-modal .tbz-notif-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
}

.tbz-notif-detail-modal .tbz-notif-detail-body {
    line-height: 1.55;
}

.tbz-notif-card__count {
    font-size: 0.9rem;
    color: var(--tbz-text-muted);
}

.tbz-notif-card__count-label {
    margin-left: 0.2rem;
}

#tbzNotifTotalCount {
    font-weight: 700;
    color: var(--tbz-text-dark);
}

.tbz-notif-card__search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.tbz-notif-card__search-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tbz-text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.tbz-notif-card__search {
    border-radius: 999px;
    padding-left: 2.5rem;
    padding-right: 1rem;
    border: 1px solid var(--tbz-border);
    background: #fafafa;
    font-size: 0.88rem;
}

.tbz-notif-card__search:focus {
    border-color: rgba(15, 138, 95, 0.45);
    box-shadow: 0 0 0 3px rgba(15, 138, 95, 0.12);
    background: #fff;
}

.tbz-notif-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 1rem;
    border-bottom: 1px solid var(--tbz-border);
    background: #fff;
}

.tbz-notif-tab {
    position: relative;
    border: none;
    background: none;
    padding: 0.85rem 1rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--tbz-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: color 0.15s;
}

.tbz-notif-tab:hover {
    color: var(--tbz-text-dark);
}

.tbz-notif-tab.active {
    color: var(--tbz-primary);
}

.tbz-notif-tab.active::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--tbz-primary);
}

.tbz-notif-tab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--tbz-primary);
    color: #fff;
}

.tbz-notif-tab:not(.active) .tbz-notif-tab__badge {
    background: #e5e7eb;
    color: var(--tbz-text-dark);
}

.tbz-notif-tab.active .tbz-notif-tab__badge--muted {
    background: var(--tbz-primary-light);
    color: var(--tbz-primary);
}

.tbz-notif-list {
    background: #fff;
}

.tbz-notif-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.95rem 1rem 0.95rem 1.1rem;
    border-bottom: 1px solid var(--tbz-border);
    transition: background 0.12s;
}

.tbz-notif-row:nth-child(even) {
    background: #f9fafb;
}

.tbz-notif-row:hover {
    background: rgba(15, 138, 95, 0.04) !important;
}

.tbz-notif-row__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.55rem;
    flex-shrink: 0;
    background: var(--tbz-primary);
    box-shadow: 0 0 0 3px rgba(15, 138, 95, 0.2);
}

.tbz-notif-row--read .tbz-notif-row__dot {
    background: #cbd5e1;
    box-shadow: none;
}

.tbz-notif-row__fav {
    border: none;
    background: none;
    padding: 0.25rem;
    margin-top: 0.2rem;
    color: var(--tbz-text-muted);
    line-height: 1;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.tbz-notif-row__fav:hover {
    color: var(--tbz-gold);
    background: var(--tbz-gold-light);
}

.tbz-notif-row--fav .tbz-notif-row__fav {
    color: var(--tbz-gold-hover);
}

.tbz-notif-row__icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f3f4f6;
}

.tbz-notif-row__icon {
    font-size: 1.1rem;
}

.tbz-notif-row__icon--email {
    color: var(--tbz-mc-blue-icon);
}

.tbz-notif-row__icon--sms {
    color: var(--tbz-mc-teal-icon);
}

.tbz-notif-row__icon--inapp {
    color: var(--tbz-mc-gold-icon);
}

.tbz-notif-row__body {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.tbz-notif-row__open {
    display: block;
    width: 100%;
    border: none;
    background: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
}

.tbz-notif-row__open:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(15, 138, 95, 0.35);
}

.tbz-notif-row__subject {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--tbz-text-dark);
    margin-bottom: 0.15rem;
}

.tbz-notif-row__preview {
    font-size: 0.83rem;
    color: var(--tbz-text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tbz-notif-row__ref {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
}

.tbz-notif-row__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
    min-width: 5.5rem;
}

.tbz-notif-row__time {
    font-size: 0.75rem;
    color: var(--tbz-text-muted);
    white-space: nowrap;
}

.tbz-notif-row__actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
}

.tbz-notif-row__btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: transform 0.12s, background 0.15s, color 0.15s;
}

.tbz-notif-row__btn--archive {
    background: #f3f4f6;
    color: var(--tbz-text-muted);
}

.tbz-notif-row__btn--archive:hover {
    background: var(--tbz-primary-light);
    color: var(--tbz-primary);
}

.tbz-notif-row__btn--delete {
    background: rgba(224, 90, 43, 0.12);
    color: var(--tbz-mc-orange-icon);
}

.tbz-notif-row__btn--delete:hover {
    background: rgba(224, 90, 43, 0.22);
    color: #c2410c;
}

.tbz-notif-empty__icon {
    font-size: 2.5rem;
    color: var(--tbz-border);
}

@media (max-width: 767.98px) {
    .tbz-notif-row {
        flex-wrap: wrap;
    }

    .tbz-notif-row__aside {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: space-between;
        padding-left: calc(10px + 0.65rem + 40px + 0.65rem);
        margin-top: 0.25rem;
    }

    .tbz-notif-row__actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.35rem;
    }
}

/* ── Permit Detail (pd-*) ─────────────────────────────────────────── */
.pd-hero {
    border: 1px solid #dcefe4;
    background: linear-gradient(135deg, #f6fffa 0%, #ffffff 60%, #eefbf4 100%);
}

.pd-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9f7ef;
    border: 1px solid #ccebd8;
    color: var(--tbz-primary);
    font-size: 1.45rem;
    flex-shrink: 0;
}

.pd-side {
    position: sticky;
    top: 84px;
}

.pd-info-row {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--tbz-border);
    font-size: .875rem;
}

.pd-info-row:last-child {
    border-bottom: none;
}

.pd-label {
    min-width: 140px;
    color: var(--tbz-text-muted);
    flex-shrink: 0;
    padding-top: .05rem;
}

.pd-value {
    font-weight: 500;
    color: #1a1a1a;
}

.pd-section-divider {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--tbz-text-muted);
    padding: .6rem 0 .2rem;
}

@media (max-width: 991.98px) {
    .pd-side {
        position: static;
    }
}

/* =============================================================
   TBZ Layout — Page Loader & Notification Popup
   (Previously inline in base.html)
   ============================================================= */

/* ── Page-loader overlay ─────────────────────────────────── */
#tbz-page-loader {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(246, 247, 248, .82);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

#tbz-page-loader.tbz-loader--active {
    opacity: 1;
    pointer-events: all;
}

.tbz-loader-ring {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--tbz-primary-light, #e7f6ef);
    border-top-color: var(--tbz-primary, #0f8a5f);
    border-radius: 50%;
    animation: tbz-spin .75s linear infinite;
}

.tbz-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

.tbz-loader-label {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--tbz-text-muted, #6b7280);
    letter-spacing: .01em;
}

@keyframes tbz-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Top progress bar ────────────────────────────────────── */
#tbz-nbar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    z-index: 9999;
    width: 0%;
    opacity: 0;
    background: linear-gradient(90deg, var(--tbz-primary, #0f8a5f) 60%, var(--tbz-gold, #c8a415));
    transition: opacity .2s ease;
    box-shadow: 0 0 8px rgba(15, 138, 95, .5);
}

#tbz-nbar.tbz-nbar--run {
    opacity: 1;
}

#tbz-nbar.tbz-nbar--done {
    opacity: 0;
    transition: opacity .35s ease .1s;
}

/* ── Notification Popup ──────────────────────────────────── */
#tbz-notify-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 20, .42);
    backdrop-filter: blur(5px) saturate(1.15);
    -webkit-backdrop-filter: blur(5px) saturate(1.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

#tbz-notify-backdrop.tbz-notify--active {
    opacity: 1;
    pointer-events: all;
}

.tbz-notify-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 28px 72px rgba(0, 0, 0, .22), 0 6px 20px rgba(0, 0, 0, .1);
    padding: 2.5rem 2rem 1.75rem;
    max-width: 380px;
    width: calc(100vw - 2.5rem);
    position: relative;
    overflow: hidden;
    text-align: center;
    transform: scale(.88);
    opacity: 0;
    transition: transform .32s cubic-bezier(.34, 1.4, .64, 1), opacity .24s ease;
}

#tbz-notify-backdrop.tbz-notify--active .tbz-notify-card {
    transform: scale(1);
    opacity: 1;
}

.tbz-notify-icon-wrap {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto 1.5rem;
}

.tbz-notify-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: .625rem;
}

.tbz-notify-message {
    font-size: .9375rem;
    color: #4b5563;
    line-height: 1.6;
    word-break: break-word;
    margin-bottom: 1.5rem;
}

.tbz-notify-ok-btn {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: .5rem;
    padding: .55rem 2.75rem;
    font-size: .9375rem;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: .01em;
    transition: background .15s ease, transform .1s ease;
}

.tbz-notify-ok-btn:hover {
    background: #2563eb;
}

.tbz-notify-ok-btn:active {
    transform: scale(.97);
}

/* ── Session expiry warning modal ──────────────────────────── */
/* Backdrop — blurred overlay matching the notification popup  */
#tbz-session-modal.show {
    background: rgba(10, 12, 20, .42);
    backdrop-filter: blur(5px) saturate(1.15);
    -webkit-backdrop-filter: blur(5px) saturate(1.15);
}

#tbz-session-modal+.modal-backdrop {
    opacity: 0 !important;
}

/* Dialog — same card width as .tbz-notify-card */
#tbz-session-modal .modal-dialog {
    max-width: 380px;
}

/* Card surface */
.tbz-session-modal-content {
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 28px 72px rgba(0, 0, 0, .22), 0 6px 20px rgba(0, 0, 0, .1);
    padding: 2.5rem 2rem 1.75rem;
    text-align: center;
    overflow: hidden;
}

/* Strip Bootstrap's default modal-body padding — card handles its own */
#tbz-session-modal .modal-body {
    padding: 0;
}

/* Icon circle — same 5.5 rem as .tbz-notify-icon-wrap, amber tint for urgency */
.tbz-session-icon {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    background: #fff8e1;
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto 1.5rem;
}

/* Title — matches .tbz-notify-title */
#tbz-session-modal-title {
    font-size: 1.375rem !important;
    font-weight: 700 !important;
    color: #111827;
    margin-bottom: .625rem !important;
}

/* Body copy — matches .tbz-notify-message */
#tbz-session-modal .modal-body p {
    font-size: .9375rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Countdown number */
.tbz-session-countdown-value {
    display: inline-block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--tbz-primary, #0f8a5f);
    line-height: 1;
    margin: .125rem 0;
}

/* Primary action button — matches .tbz-notify-ok-btn */
#tbz-session-extend {
    display: block;
    width: 100%;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: .5rem;
    padding: .6rem 1.5rem;
    font-size: .9375rem;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: .01em;
    transition: background .15s ease, transform .1s ease;
}

#tbz-session-extend:hover {
    background: #2563eb;
}

#tbz-session-extend:active {
    transform: scale(.97);
}

/* Secondary action button */
#tbz-session-signout {
    display: block;
    width: 100%;
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: .6rem 1.5rem;
    font-size: .875rem;
    font-weight: 400;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

#tbz-session-signout:hover {
    background: #f9fafb;
    color: #374151;
}