﻿* {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* ---------------------------
   Default tokens (DARK)
   --------------------------- */
:root {
    --gt-bg: #0f172a; /* slate-900 */
    --gt-bg-2: #111827; /* gray-900 */
    --gt-surface: #0b1324;
    --gt-surface-2: #0f213b;
    --gt-border: #1f2a44;
    --gt-text: #e5e7eb; /* gray-200 */
    --gt-text-muted: #9ca3af; /* gray-400 */
    --gt-accent: #3b82f6; /* blue-500 */
    --gt-accent-2: #60a5fa;
    --gt-sidebar-w: 260px;
    --gt-sidebar-w-collapsed: 64px;
    --nav-h: 62px;
    --footer-h: 42px;
    /* Ghost buttons (dark defaults) */
    --btn-ghost-color: #e5e7eb;
    --btn-ghost-border: rgba(255,255,255,.18);
    --btn-ghost-hover: rgba(255,255,255,.08);
    --logo-light: url('/images/GovTransferLogo_OvWhite.png');
    --logo-light-hover: url('/images/GovTransferLogo_Gray.png');
    --logo-dark: url('/images/GovTransferLogo_OvBlack.png');
    --logo-dark-hover: url('/images/GovTransferLogo_Gray.png');
}

/* ---------------------------
   LIGHT theme overrides
   --------------------------- */
html[data-theme="light"] {
    --gt-bg: #ffffff;
    --gt-bg-2: #f8fafc;
    --gt-surface: #ffffff;
    --gt-surface-2: #ffffff;
    --gt-border: #d1d5db;
    --gt-text: #111827;
    --gt-text-muted: #4b5563;
    --gt-accent: #2563eb;
    --gt-accent-2: #3b82f6;
    --btn-ghost-color: #0f172a;
    --btn-ghost-border: rgba(15,23,42,.18);
    --btn-ghost-hover: rgba(15,23,42,.08);
}

/* ---------------------------
   MID theme overrides
   (balanced contrast, not as bright as Light, not as deep as Dark)
   --------------------------- */
html[data-theme="mid"] {
    /* Backgrounds: mid-slate (not near-black) */
    --gt-bg: #243041; /* slate-ish 800 */
    --gt-bg-2: #1f2937; /* gray-800 */
    /* Surfaces: lifted panels */
    --gt-surface: #2b3a4f; /* readable card bg */
    --gt-surface-2: #31435c; /* secondary lift / sidebar */
    /* Borders: visible on mid surfaces */
    --gt-border: rgba(226, 232, 240, 0.22);
    /* Text: keep bright enough for readability */
    --gt-text: #f1f5f9; /* slate-100 */
    --gt-text-muted: #cbd5e1; /* slate-300 */
    /* Accent: keep brand blue but slightly less neon */
    --gt-accent: #3b82f6;
    --gt-accent-2: #93c5fd;
    /* Ghost buttons: tune to mid */
    --btn-ghost-color: #f1f5f9;
    --btn-ghost-border: rgba(241,245,249,.22);
    --btn-ghost-hover: rgba(241,245,249,.10);
}

html[data-theme="ocean"] {
    --gt-bg: #061a23;
    --gt-bg-2: #072432;
    --gt-surface: #0b2b3a;
    --gt-surface-2: #0f3a4f;
    --gt-border: rgba(148, 163, 184, 0.24);
    --gt-text: #e6f6ff;
    --gt-text-muted: #a9c7d8;
    --gt-accent: #22c1c3; /* teal */
    --gt-accent-2: #3b82f6; /* blue */

    --btn-ghost-color: #e6f6ff;
    --btn-ghost-border: rgba(230,246,255,.20);
    --btn-ghost-hover: rgba(230,246,255,.10);
}

html[data-theme="forest"] {
    --gt-bg: #0b1f16;
    --gt-bg-2: #0a261a;
    --gt-surface: #102b1f;
    --gt-surface-2: #143626;
    --gt-border: rgba(167, 243, 208, 0.18);
    --gt-text: #ecfdf5;
    --gt-text-muted: #b7e4cf;
    --gt-accent: #34d399; /* green-mint */
    --gt-accent-2: #60a5fa; /* keep a blue secondary for links/buttons */

    --btn-ghost-color: #ecfdf5;
    --btn-ghost-border: rgba(236,253,245,.18);
    --btn-ghost-hover: rgba(236,253,245,.10);
}

html[data-theme="blues"] {
    --gt-bg: #0b1220;
    --gt-bg-2: #0c1a33;
    --gt-surface: #0f2344;
    --gt-surface-2: #12305d;
    --gt-border: rgba(147, 197, 253, 0.22);
    --gt-text: #eaf2ff;
    --gt-text-muted: #b7cdf6;
    --gt-accent: #3b82f6;
    --gt-accent-2: #93c5fd;
    --btn-ghost-color: #eaf2ff;
    --btn-ghost-border: rgba(234,242,255,.18);
    --btn-ghost-hover: rgba(234,242,255,.10);
}

/* =========================================================
   Bootstrap 5.3 color-mode bridge (ties BS vars to GT vars)
   Requires: <html data-bs-theme="dark|light">
   NOTE: Bootstrap only supports light/dark officially; for "mid"
   use data-bs-theme="dark" and override the vars below.
   ========================================================= */

/* =========================================================
   Bootstrap bridge - apply to ALL themes
   ========================================================= */

/* Default: for any theme, bind Bootstrap variables to GT variables */
html[data-theme] {
    --bs-body-bg: var(--gt-bg);
    --bs-body-color: var(--gt-text);
    --bs-border-color: var(--gt-border);
    --bs-secondary-color: var(--gt-text-muted);
    --bs-card-bg: var(--gt-surface);
    --bs-card-color: var(--gt-text);
    --bs-modal-bg: var(--gt-surface);
    --bs-dropdown-bg: var(--gt-surface);
    /* For "dark-ish" themes, this should be a lifted surface */
    --bs-secondary-bg: var(--gt-surface-2);
}

html[data-theme="dark"] {
    --bs-body-bg: var(--gt-bg);
    --bs-body-color: var(--gt-text);
    --bs-border-color: var(--gt-border);
    --bs-secondary-color: var(--gt-text-muted);
    --bs-card-bg: var(--gt-surface);
    --bs-card-color: var(--gt-text);
    --bs-modal-bg: var(--gt-surface);
    --bs-dropdown-bg: var(--gt-surface);
    --bs-secondary-bg: var(--gt-surface-2);
}

html[data-theme="light"] {
    --bs-body-bg: var(--gt-bg);
    --bs-body-color: var(--gt-text);
    --bs-border-color: var(--gt-border);
    --bs-secondary-color: var(--gt-text-muted);
    --bs-card-bg: var(--gt-surface);
    --bs-card-color: var(--gt-text);
    --bs-modal-bg: var(--gt-surface);
    --bs-dropdown-bg: var(--gt-surface);
    --bs-secondary-bg: var(--gt-bg-2);
}

/* Mid: treat Bootstrap as "dark" but nudge its surface vars to match Mid */
html[data-theme="mid"] {
    --bs-body-bg: var(--gt-bg);
    --bs-body-color: var(--gt-text);
    --bs-border-color: var(--gt-border);
    --bs-secondary-color: var(--gt-text-muted);
    --bs-card-bg: var(--gt-surface);
    --bs-card-color: var(--gt-text);
    --bs-modal-bg: var(--gt-surface);
    --bs-dropdown-bg: var(--gt-surface);
    --bs-secondary-bg: var(--gt-surface-2);
}

/* Your app base colors */
html, body {
    height: 100%;
}

body {
    font-size: 14px;
    background: var(--gt-bg);
    color: var(--gt-text);
}

    body.gt-sidebar-expanded .gt-content {
        margin-left: var(--gt-sidebar-w);
    }

    body.gt-sidebar-collapsed .gt-content {
        margin-left: var(--gt-sidebar-w-collapsed);
    }

    /* Optional footer spacer helper if you render it */
    body.gt-sidebar-collapsed .gt-footer .spacer-left {
        width: var(--gt-sidebar-w-collapsed);
    }

/* Pins get our blue accent */
i.fa-thumbtack-angle {
    color: var(--gt-accent);
}

/* ─────────────────────────────────────────────────────────
   Bootstrap 5.3 color-mode bridge (ties BS vars to GT vars)
   Requires: <html data-bs-theme="dark|light">
   ───────────────────────────────────────────────────────── */

html[data-theme="dark"] {
    --bs-body-bg: var(--gt-bg);
    --bs-body-color: var(--gt-text);
    --bs-border-color: var(--gt-border);
    --bs-secondary-color: var(--gt-text-muted);
    --bs-card-bg: var(--gt-surface);
    --bs-card-color: var(--gt-text);
    --bs-modal-bg: var(--gt-surface);
    --bs-dropdown-bg: var(--gt-surface);
    --bs-secondary-bg: var(--gt-surface-2);
}

html[data-theme="light"] {
    --bs-body-bg: var(--gt-bg);
    --bs-body-color: var(--gt-text);
    --bs-border-color: var(--gt-border);
    --bs-secondary-color: var(--gt-text-muted);
    --bs-card-bg: var(--gt-surface);
    --bs-card-color: var(--gt-text);
    --bs-modal-bg: var(--gt-surface);
    --bs-dropdown-bg: var(--gt-surface);
    --bs-secondary-bg: var(--gt-bg-2);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: var(--gt-surface) !important;
    color: var(--gt-text) !important;
    border-color: var(--gt-border) !important;
}

    html[data-theme="dark"] .form-control::placeholder {
        color: var(--gt-text-muted) !important;
    }

.gt-navbar {
    background: linear-gradient(180deg, var(--gt-bg), var(--gt-bg-2));
    border-bottom: 1px solid var(--gt-border);
    font-size: .95rem;
}

    .gt-navbar .nav-link, .gt-navbar .navbar-brand {
        color: var(--gt-text);
    }

        .gt-navbar .navbar-brand:hover, .gt-navbar .nav-link:hover {
            filter: brightness(1.08);
            color: var(--gt-text);
        }

.gt-dropdown {
    right: .25rem !important;
    left: auto !important;
}

/* Ghost icon buttons with strong contrast in both themes */
.btn-ghost {
    color: var(--btn-ghost-color) !important;
    border: 1px solid var(--btn-ghost-border) !important;
    background: transparent !important;
}

    .btn-ghost:hover {
        background: var(--btn-ghost-hover) !important;
        color: var(--btn-ghost-color) !important;
    }

/* Search input legibility */
.gt-navbar .form-control {
    color: var(--gt-text) !important;
}

    .gt-navbar .form-control::placeholder {
        color: var(--gt-text-muted) !important;
    }

/* Avatar button in navbar */
.user-avatar-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-width: 0;
    background-color: var(--bs-gray-800);
}

[data-theme="light"] .user-avatar-btn {
    background-color: #e5e7eb; /* light gray */
}

/* Small avatar in navbar */
.user-avatar-img,
.user-avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.user-avatar-initials {
    background: #111827;
    color: #f9fafb;
}

/* Larger avatar in dropdown */
.user-avatar-img-lg,
.user-avatar-circle-lg {
    width: 56px;
    height: 56px;
    border-radius: 999px;
}

.user-avatar-img-lg {
    object-fit: cover;
}

.user-avatar-circle-lg {
    background: #111827;
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

/* Card styling */
.user-menu-card {
    min-width: 360px;
    width: 400px;
    max-width: 460px;
    padding: 0;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}

[data-theme="dark"] .user-menu-card {
    background-color: #020617;
    border-color: rgba(30, 64, 175, 0.7);
}

.user-menu-card .btn-primary.btn-sm {
    padding-inline: 0.9rem;
    font-size: 0.8rem;
}

[data-theme="light"] .user-avatar-btn {
    background-color: #e5e7eb;
}

[data-theme="dark"] .user-avatar-btn {
    border: 1px solid #4b5563; /* subtle ring in dark mode */
}

.user-avatar-img {
    object-fit: cover;
    display: block;
}

.user-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    background: #111827;
    color: #f9fafb;
}

[data-theme="light"] .user-menu-card {
    background-color: #ffffff;
}

[data-theme="dark"] .user-menu-card {
    background-color: #020617;
    border-color: rgba(31, 41, 55, 0.9);
}

.user-menu-section {
    padding: 0.75rem 1rem;
}

/* Header */
.user-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.user-menu-app {
    font-weight: 500;
    color: #6b7280;
}

[data-theme="dark"] .user-menu-app {
    color: #9ca3af;
}

.user-menu-logout {
    color: #ef4444;
}

/* Profile row */
.user-menu-profile {
    display: flex;
    gap: 0.9rem;
    align-items: center;
}

.user-menu-avatar {
    flex-shrink: 0;
}

/* Initials circle in dropdown */
.user-avatar-circle-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
}

[data-theme="light"] .user-avatar-circle-lg {
    background-color: #111827;
    color: #f9fafb;
    border: 2px solid #e5e7eb;
}

[data-theme="dark"] .user-avatar-circle-lg {
    background-color: #020617;
    color: #f9fafb;
    border: 2px solid #4b5563;
}

.user-menu-details {
    min-width: 0;
}

.user-menu-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-menu-username,
.user-menu-email {
    font-size: 0.8rem;
    color: #6b7280;
}

[data-theme="dark"] .user-menu-username,
[data-theme="dark"] .user-menu-email {
    color: #9ca3af;
}

/* Primary action */
.user-menu-primary {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
}

    .user-menu-primary .btn-primary {
        font-size: 0.82rem;
        font-weight: 500;
        border-radius: 999px; /* pill */
        color: #ffffff;
    }

[data-theme="light"] .user-menu-primary .btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
}

[data-theme="dark"] .user-menu-primary .btn-primary {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* Secondary actions */
.user-menu-secondary {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.9rem;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
}

    .user-menu-secondary .btn-sm {
        font-size: 0.8rem;
    }

[data-theme="dark"] .user-menu-card .btn-outline-secondary {
    border-color: #4b5563;
    color: #e5e7eb;
}

    [data-theme="dark"] .user-menu-card .btn-outline-secondary:hover {
        background-color: #111827;
    }

/* Generic "looks like a link but is a button" helper */
.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

/* Specific color for logout link */
.user-menu-logout {
    color: #ef4444; /* red-500 */
}

    .user-menu-logout:hover {
        text-decoration: underline;
    }

/* ───────────────────────────────── Sidebar ───────────────────────────────── */

/* Sidebar shell */
#gtSidebar {
    overflow: hidden; /* don't let the <aside> itself create scrollbars */
}

    /* Sidebar is fixed between navbar + app footer */
    #gtSidebar.gt-sidebar {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        bottom: var(--footer-h);
        width: var(--gt-sidebar-w);
        background: linear-gradient(180deg, var(--gt-surface), var(--gt-surface-2));
        border-right: 1px solid var(--gt-border);
        display: flex;
        flex-direction: column;
        overflow: hidden; /* sidebar itself does NOT scroll */
        transition: width .2s ease;
        z-index: 1030;
        padding-bottom: 0 !important;
    }

        #gtSidebar.gt-sidebar.collapsed {
            width: var(--gt-sidebar-w-collapsed);
        }

    /* The scrollable area inside the sidebar */
    #gtSidebar .gt-sidebar-body {
        flex: 1 1 auto;
        min-height: 0; /* allows scrolling in flex layouts */
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* ───────── Top mini header (Main + Pin) ───────── */
    #gtSidebar .sidebar-top {
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 .5rem;
        background: var(--gt-surface-2);
        border-bottom: 1px solid var(--gt-border);
    }

    /* When collapsed: hide top area */
    #gtSidebar.gt-sidebar.collapsed .sidebar-top,
    #gtSidebar.gt-sidebar.collapsed #sidebarPin {
        display: none !important;
    }

    /* ───────── Section containers (sortable) ───────── */
    #gtSidebar .gt-sidebar-section {
        display: block;
    }

    /* Header row that contains: [handle] [title/caret] [kebab] */
    #gtSidebar .gt-side-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 34px;
        padding: 0 .35rem; /* keeps header controls off the edge */
    }

        /* Left side (drag + title) */
        #gtSidebar .gt-side-section-header .gt-side-section-left {
            display: flex;
            align-items: center;
            gap: 0; /* only add gap in edit mode */
            min-width: 0;
        }

    /* Section title styling (scoped!) */
    #gtSidebar .section-title {
        font-size: .75rem;
        letter-spacing: .08em;
        color: var(--gt-text-muted);
        padding: .45rem .65rem; /* centered; fixes “Links sits low” */
        text-transform: uppercase;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        min-width: 0;
    }

        #gtSidebar .section-title[role="button"],
        #gtSidebar .section-title[data-bs-toggle="collapse"] {
            cursor: pointer;
        }

            #gtSidebar .section-title[role="button"]:hover {
                opacity: 0.85;
            }

    /* Caret polish (scoped) */
    #gtSidebar .sidebar-section-toggle {
        cursor: pointer;
        user-select: none;
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        min-width: 0;
    }

        #gtSidebar .sidebar-section-toggle .sidebar-caret {
            line-height: 1;
            transition: transform 160ms ease;
            transform-origin: 50% 45%;
            transform: translateY(-1px) rotate(0deg);
        }

        #gtSidebar .sidebar-section-toggle[aria-expanded="false"] .sidebar-caret {
            transform: translateY(-1px) rotate(-90deg);
        }

@media (prefers-reduced-motion: reduce) {
    #gtSidebar .sidebar-section-toggle .sidebar-caret {
        transition: none;
    }
}

/* ───────── Section reorder handle + kebab (edit-only chrome) ───────── */
#gtSidebar .gt-section-drag,
#gtSidebar .gt-section-kebab {
    display: none !important; /* default hidden */
}

body.gt-sidebar-edit #gtSidebar .gt-side-section-header .gt-side-section-left {
    gap: .35rem;
}

/* Edit mode: show controls, but keep them subtle */
body.gt-sidebar-edit #gtSidebar .gt-section-drag,
body.gt-sidebar-edit #gtSidebar .gt-section-kebab {
    display: inline-flex !important;
    width: 28px;
    height: 28px;
    padding: 0 !important;
    margin: 0;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 8px;
    opacity: .35;
    transition: opacity 120ms ease, background-color 120ms ease;
}

body.gt-sidebar-edit #gtSidebar .gt-side-section-header:hover .gt-section-drag,
body.gt-sidebar-edit #gtSidebar .gt-side-section-header:hover .gt-section-kebab {
    opacity: .9;
}

body.gt-sidebar-edit #gtSidebar .gt-section-drag:hover,
body.gt-sidebar-edit #gtSidebar .gt-section-kebab:hover {
    background: var(--btn-ghost-hover) !important;
}

body.gt-sidebar-edit #gtSidebar .gt-section-drag {
    cursor: grab;
}

body.gt-sidebar-edit #gtSidebar .gt-sidebar-section.ui-sortable-helper .gt-section-drag {
    cursor: grabbing;
}

/* Optional edit-mode cue */
body.gt-sidebar-edit #gtSidebar.gt-sidebar {
    box-shadow: inset 0 0 0 1px rgba(59,130,246,.25);
}

/* Placeholder while dragging sections */
#gtSidebar .gt-section-placeholder {
    height: 40px;
    margin: .25rem .5rem;
    border: 1px dashed var(--gt-border);
    border-radius: 10px;
    background: rgba(0,0,0,.02);
}

/* Collapsed sidebar: never show edit chrome */
#gtSidebar.gt-sidebar.collapsed .gt-section-drag,
#gtSidebar.gt-sidebar.collapsed .gt-section-kebab {
    display: none !important;
}

/* ───────── Sidebar links (scoped) ───────── */
#gtSidebar a.gt-side-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .5rem;
    white-space: nowrap;
    border-radius: .5rem;
    min-width: 0;
}

    #gtSidebar a.gt-side-link i {
        display: inline-block;
        width: 1.5rem;
        text-align: center;
        flex-shrink: 0;
        font-size: 1.1rem;
    }

    #gtSidebar a.gt-side-link:hover {
        background: rgba(0,0,0,.04);
        color: var(--gt-text);
    }

    #gtSidebar a.gt-side-link.active {
        background: rgba(59,130,246,.12);
        border-left-color: var(--gt-accent);
        color: var(--gt-text);
    }

    /* Better label clipping (sidebar only) */
    #gtSidebar a.gt-side-link .gt-side-text {
        min-width: 0;
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        white-space: normal;
    }

/* Subnav */
#gtSidebar .gt-subnav {
    padding-left: .25rem;
    border-left: 1px dashed var(--gt-border);
    margin-left: .5rem;
}

    #gtSidebar .gt-subnav a.gt-side-link {
        padding-left: 2.25rem;
    }

/* Collapsed mode: hide labels/subnav; center icons */
#gtSidebar.gt-sidebar.collapsed .section-title,
#gtSidebar.gt-sidebar.collapsed a.gt-side-link span,
#gtSidebar.gt-sidebar.collapsed a.gt-side-link .fa-caret-down,
#gtSidebar.gt-sidebar.collapsed .gt-subnav {
    display: none !important;
}

#gtSidebar.gt-sidebar.collapsed a.gt-side-link {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

/* ───────── Footer row INSIDE sidebar (Edit + Collapse) ───────── */
#gtSidebar .sidebar-footer {
    flex: 0 0 auto;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    gap: .5rem;
    background: linear-gradient(180deg, var(--gt-surface), var(--gt-surface-2));
    border-top: 1px solid var(--gt-border);
}

    /* Footer buttons */
    #gtSidebar .sidebar-footer .gt-sidebar-edit-btn,
    #gtSidebar .sidebar-footer .sidebar-collapse-btn {
        height: 32px;
        min-height: 32px;
        line-height: 1;
        padding: 0 .55rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: none !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Collapse button: square-ish icon button */
    #gtSidebar .sidebar-footer .sidebar-collapse-btn {
        width: 36px;
        padding: 0 !important;
    }

    /* Edit button: icon+text tidy */
    #gtSidebar .sidebar-footer .gt-sidebar-edit-btn {
        gap: .4rem;
    }

/* Collapsed sidebar: hide Edit (per your preference) */
#gtSidebar.gt-sidebar.collapsed .gt-sidebar-edit-btn {
    display: none !important;
}

/* Collapsed: keep collapse button centered + always visible */
#gtSidebar.gt-sidebar.collapsed .sidebar-footer {
    justify-content: center;
}

#gtSidebar.gt-sidebar.collapsed #sidebarCollapse,
#gtSidebar.gt-sidebar.collapsed .sidebar-collapse-btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ───────── Mobile ───────── */
@media (max-width: 991.98px) {
    #gtSidebar.gt-sidebar {
        width: 280px;
    }

        #gtSidebar.gt-sidebar.collapsed {
            width: 280px;
        }
    /* ignore collapsed width on mobile */

    body .gt-content,
    body .gt-footer .inner {
        margin-left: 0;
    }
}


/* ─────────────────────────────── Layout / Content / Cards ─────────────────────────────── */

.gt-crumbs {
    border-bottom: 1px solid var(--gt-border);
    margin-bottom: .75rem;
}

/* Cards */
.gt-card {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--gt-border);
    border-radius: 14px;
}

html[data-theme="light"] .gt-card {
    background: #fff;
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

html[data-theme="light"] .card-header.bg-body {
    background-color: #f7f8fa !important;
    border-bottom: 1px solid rgba(0,0,0,0.04) !important;
}

html[data-theme="dark"] .card-header.bg-body {
    background-color: rgba(255,255,255,0.04) !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
}

.gt-card .card-header {
    color: var(--gt-text);
    background: transparent;
    border-bottom: 1px solid var(--gt-border);
}

.gt-muted {
    color: var(--gt-text-muted);
}

/* Fixed footer */
.gt-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483005;
    border-top: 1px solid var(--gt-border, #dcdfe4);
    background: var(--gt-surface, #fff);
}

    .gt-footer,
    .gt-footer * {
        pointer-events: auto;
    }

.gt-footer-inner {
    min-height: 42px;
    padding: 6px 12px;
}

.gt-footer-left {
    flex: 1 1 auto;
}

    .gt-footer .spacer-left {
        width: var(--gt-sidebar-w);
    }

.gt-recorder-tools-bar {
    flex: 0 1 auto;
}

.gt-recorder-tool-btn {
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .gt-footer-inner {
        align-items: flex-start !important;
    }

    .gt-footer-left,
    .gt-recorder-tools-bar {
        width: 100%;
    }

    .gt-recorder-tools-bar {
        justify-content: flex-start !important;
    }
}

/* Utilities for inner scrolling panels */
.gt-scroll-40vh {
    max-height: 40vh;
    overflow: auto;
}

.gt-scroll-30vh {
    max-height: 30vh;
    overflow: auto;
}

/* Logo */
.gt-logo {
    display: inline-block;
    width: calc(var(--nav-h) / 2) !important;
    height: calc(var(--nav-h) / 2) !important;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center left;
    transition: background-image 0.2s ease-in-out;
}

/* Theme-aware images */
html[data-theme="light"] .gt-logo {
    background-image: var(--logo-light);
}

html:not([data-theme="light"]) .gt-logo {
    background-image: var(--logo-dark);
}

/* Hover variants */
html[data-theme="light"] .gt-logo:hover {
    background-image: var(--logo-light-hover);
}

html:not([data-theme="light"]) .gt-logo:hover {
    background-image: var(--logo-dark-hover);
}

/* Toastr */
#toast-container > .toast {
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    border: 1px solid var(--gt-border);
}

html[data-theme="dark"] #toast-container > .toast-success {
    background-color: #12341d !important;
    border-color: #1f9d55 !important;
}

html[data-theme="dark"] #toast-container > .toast-info {
    background-color: #0d3045 !important;
    border-color: #3298db !important;
}

html[data-theme="dark"] #toast-container > .toast-warning {
    background-color: #3a2d09 !important;
    border-color: #d97706 !important;
}

html[data-theme="dark"] #toast-container > .toast-error {
    background-color: #3a0d0d !important;
    border-color: #ef4444 !important;
}

/* Keep on top of navbar/sidebar */
#toast-container {
    z-index: 1080;
}

    #toast-container > .toast {
        opacity: 0.95;
        border-radius: 6px;
        min-width: 350px !important;
    }

.toast-top-right {
    top: calc(var(--nav-h));
    right: 8px;
}

.toast-title, .toast-message {
    color: #FFFFFF !important;
}

/* Content shell */
.gt-content {
    /* Let body flags control the left offset */
    margin-left: 0;
    padding: 1rem;
    padding-top: var(--nav-h);
    padding-bottom: calc(var(--footer-h) + 1rem);
    min-height: 100%;
}

/* Main wrapper width reacts to sidebar width */
main.gt-content {
    width: 100%;
    min-width: 0;
}

body.gt-sidebar-expanded main.gt-content {
    max-width: calc(100% - var(--gt-sidebar-w));
}

body.gt-sidebar-collapsed main.gt-content {
    max-width: calc(100% - var(--gt-sidebar-w-collapsed));
}

/* -------------------------------------------------------
   Global Link Styling (GovTransfer)
   ------------------------------------------------------- */

/* Default: neutral, not shouty */
a {
    color: var(--gt-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

    /* Hover / focus: use your accent */
    a:hover,
    a:focus-visible {
        color: var(--gt-accent);
        text-decoration: none;
    }

    /* Visited: slightly different, but still subtle */
    a:visited {
        color: color-mix(in srgb, var(--gt-text-muted) 85%, var(--gt-accent) 15%);
    }

    /* Explicit “this is important” links */
    .link-accent,
    a.link-accent {
        color: var(--gt-accent);
    }

        .link-accent:hover {
            color: var(--gt-accent-2);
        }

/* -------------------------------------------------------
   Widget exceptions: file cabinet should not inherit global link muting
   ------------------------------------------------------- */

/* Any anchor inside the file cabinet should behave like normal UI text,
   unless explicitly marked as a "real link". */
.gt-fc a:not(.gt-fc-real-link):not(.link-accent) {
    color: var(--gt-text);
}

    /* Hover/focus inside file cabinet should NOT turn everything accent-blue. */
    .gt-fc a:not(.gt-fc-real-link):not(.link-accent):hover,
    .gt-fc a:not(.gt-fc-real-link):not(.link-accent):focus-visible {
        color: var(--gt-text);
    }

/* If you have anchors that truly are links (e.g., "open in new tab"), opt them in */
.gt-fc a.gt-fc-real-link {
    color: var(--gt-accent);
}

    .gt-fc a.gt-fc-real-link:hover,
    .gt-fc a.gt-fc-real-link:focus-visible {
        color: var(--gt-accent-2);
    }

/* Strengthen the header title + icon specifically */
.gt-fc .gt-fc-tree-title,
.gt-fc .gt-fc-tree-title i {
    color: var(--gt-text);
    opacity: 1;
}

.gt-fc-crumb {
    border: 0px;
    background: unset;
}

    .gt-fc-crumb i {
        margin-right: 2px;
    }

/* Breadcrumb crumbs are currently styled as buttons (.gt-fc-crumb),
   but if any are anchors, keep them strong too */
.gt-fc .gt-fc-breadcrumb a {
    color: var(--gt-text);
}

.font-monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Rotate caret when expanded */
.rot-180 {
    transform: rotate(180deg);
    transition: transform .15s ease-in-out;
}

/* ---------------------------
   Dark Mode Overrides for Tables
   --------------------------- */
html[data-theme="dark"] .table {
    --bs-table-bg: var(--gt-bg-2);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-striped-color: #fff;
    --bs-table-border-color: rgba(255, 255, 255, 0.1);
    --bs-table-color: #e5e7eb;
}

    html[data-theme="dark"] .table thead th {
        color: #f3f4f6;
        border-bottom-color: rgba(255, 255, 255, 0.15);
    }

    html[data-theme="dark"] .table td,
    html[data-theme="dark"] .table th {
        border-color: rgba(255, 255, 255, 0.1);
    }

/* Use Bootstrap's theme colors for subtle text inside the session modal */
#gt-session-timeout-modal .gt-session-subtle {
    color: var(--bs-secondary-color);
}

/* Make the modal background follow dark mode properly */
#gt-session-timeout-modal .modal-content {
    background-color: var(--gt-bg);
    color: var(--bs-body-color);
}

/* Dark-mode tweak: progress track a bit dimmer so the bar pops */
[data-bs-theme="dark"] #gt-session-timeout-modal .progress {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Optional: soften the header in dark mode if the blue is too loud */
[data-bs-theme="dark"] #gt-session-timeout-modal .modal-header {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

/* ===========================================
   DataTables 2.x dark mode (length, search, info, paging)
   =========================================== */

html[data-theme="dark"] .dt-container {
    color: #e2e8f0; /* text color */
}

    /* "Show N entries" */
    html[data-theme="dark"] .dt-container .dt-length label {
        color: #e2e8f0;
    }

    html[data-theme="dark"] .dt-container .dt-length select {
        background-color: #1e293b;
        color: #e2e8f0;
        border: 1px solid #334155;
    }

    /* Search */
    html[data-theme="dark"] .dt-container .dt-search label {
        color: #e2e8f0;
    }

    html[data-theme="dark"] .dt-container .dt-search input {
        background-color: #1e293b !important;
        color: #e2e8f0 !important;
        border: 1px solid #334155 !important;
    }

    /* Info text ("Showing 1 to 10 of 150 entries") */
    html[data-theme="dark"] .dt-container .dt-info {
        color: #94a3b8;
    }

    /* Pagination */
    html[data-theme="dark"] .dt-container .dt-paging .dt-paging-button {
        color: #e2e8f0 !important;
        background: none !important;
        border: 1px solid transparent !important;
    }

        /* Hover */
        html[data-theme="dark"] .dt-container .dt-paging .dt-paging-button:hover {
            background-color: #1e293b !important;
            border-color: #334155 !important;
            color: #ffffff !important;
        }

        /* Current page */
        html[data-theme="dark"] .dt-container .dt-paging .dt-paging-button.current,
        html[data-theme="dark"] .dt-container .dt-paging .dt-paging-button.current:hover {
            background-color: #334155 !important;
            border-color: #475569 !important;
            color: #ffffff !important;
        }

        /* Disabled */
        html[data-theme="dark"] .dt-container .dt-paging .dt-paging-button.disabled {
            color: #475569 !important;
        }

    /* ============================
   DataTables 2.x pagination in dark mode
   ============================ */

    html[data-theme="dark"] .dt-container .dt-paging .pagination .page-link {
        background-color: #0f172a !important; /* match your navbar background */
        color: #e2e8f0 !important; /* light text */
        border-color: #1f2937 !important; /* subtle border */
    }

        /* Hover */
        html[data-theme="dark"] .dt-container .dt-paging .pagination .page-link:hover {
            background-color: #1e293b !important;
            color: #ffffff !important;
            border-color: #334155 !important;
        }

    /* Active/current page (Bootstrap adds .active on the li) */
    html[data-theme="dark"] .dt-container .dt-paging .pagination .page-item.active .page-link {
        background-color: #2563eb !important; /* your blue highlight */
        color: #ffffff !important;
        border-color: #2563eb !important;
    }

    /* Disabled (e.g., « on first page, » on last page) */
    html[data-theme="dark"] .dt-container .dt-paging .pagination .page-item.disabled .page-link {
        background-color: #0f172a !important;
        color: #4b5563 !important; /* muted text */
        border-color: #1f2937 !important;
    }

.gt-history-menu {
    width: 600px;
    max-width: min(600px, 92vw);
    overflow: hidden;
    border-radius: 14px;
    box-shadow: var(--bs-box-shadow-lg);
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.gt-history-header {
    background: color-mix(in srgb, var(--bs-body-bg) 85%, var(--bs-secondary-bg) 15%);
}

.gt-history-body {
    max-height: 480px;
    overflow-y: auto;
}

.gt-history-day {
    padding: .65rem .95rem .35rem .95rem;
    font-weight: 600;
    font-size: .85rem;
    color: var(--bs-secondary-color);
}

.gt-history-item {
    display: grid;
    grid-template-columns: 72px 1fr; /* was 88px */
    gap: .5rem; /* was .75rem */
    padding: .45rem .95rem; /* slightly tighter */
    text-decoration: none;
    color: var(--bs-body-color);
    cursor: pointer;
    align-items: baseline; /* key: aligns time + first line of title */
}

.gt-history-time {
    font-variant-numeric: tabular-nums;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    line-height: 1.1;
}

.gt-history-title {
    line-height: 1.1; /* keeps it “pro” and lined up */
    word-break: break-word;
}

.gt-history-empty,
.gt-history-loading,
.gt-history-error {
    padding: .9rem .95rem;
}

.gt-history-footer {
    background: var(--bs-body-bg);
}

.gt-history-toggle.dropdown-toggle::after {
    display: none !important;
}

.gt-history-toggle {
    text-decoration: none !important;
}

.gt-history-item-page {
    border-radius: 10px;
}

    .gt-history-item-page + .gt-history-item-page {
        border-top: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
    }

.gt-history-item {
    position: relative;
    padding-right: 2.25rem;
}

.gt-history-remove {
    position: absolute;
    top: 50%;
    right: .65rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    opacity: 0;
    pointer-events: none;
    padding: .15rem .25rem;
    border-radius: .5rem;
}

.gt-history-item:hover .gt-history-remove {
    opacity: .9;
    pointer-events: auto;
}

.gt-history-remove:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--bs-secondary-bg) 70%, transparent);
}

/* History dropdown "Clear" button: link look, no underline, bold on hover */
#gtHistoryClearDropdownBtn {
    text-decoration: none !important;
    font-weight: 500;
}

    #gtHistoryClearDropdownBtn:hover,
    #gtHistoryClearDropdownBtn:focus {
        text-decoration: none !important;
        font-weight: 700;
    }

#gtFileCabinetModal .modal-dialog {
    max-width: min(1600px, 98vw); /* BIG, but not absurd */
    height: auto;
}

#gtFileCabinetModal .modal-body {
    overflow: hidden; /* modal never scrolls */
    padding: .25rem !important;
    flex: 1 1 auto;
    min-height: 0;
}

#gtFileCabinetModal .modal-content {
    height: min(80vh, 900px); /* tall, but intentional */
    display: flex;
    flex-direction: column;
}

#gtFileCabinetModal .gt-fc {
    max-height: calc(90vh - 3rem) !important;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.gt-help-menu {
    width: 600px;
    max-width: min(600px, 92vw);
    overflow: hidden;
    border-radius: 14px;
    box-shadow: var(--bs-box-shadow-lg);
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.gt-help-header {
    background: color-mix(in srgb, var(--bs-body-bg) 85%, var(--bs-secondary-bg) 15%);
}

.gt-help-body {
    max-height: min(80vh, 760px);
    overflow-y: auto;
}

.gt-help-item {
    display: grid;
    grid-template-columns: 72px 1fr; /* was 88px */
    gap: .5rem; /* was .75rem */
    padding: .45rem .95rem; /* slightly tighter */
    text-decoration: none;
    color: var(--bs-body-color);
    cursor: pointer;
    align-items: baseline; /* key: aligns time + first line of title */
}

@media (min-width: 1600px) {
    #gtFileCabinetModal .modal-dialog {
        max-width: 90vw;
    }
}

/* Pattern test modal: aligned results */
.gt-pattern-grid {
    display: grid;
    grid-template-columns: minmax(240px, 40%) 1fr;
    column-gap: 1rem;
    row-gap: .5rem;
    align-items: baseline;
}

.gt-pattern-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-pattern-sample {
    word-break: break-word;
}

/* On small screens, stack */
@media (max-width: 576px) {
    .gt-pattern-grid {
        grid-template-columns: 1fr;
    }

    .gt-pattern-name {
        white-space: normal;
    }
}

#casesSub .ps-3 {
    transition: opacity 160ms ease;
}

#casesSub:not(.show) .ps-3 {
    opacity: 0.0;
}

.gt-side-section-toggle {
    cursor: pointer;
    user-select: none;
}

    .gt-side-section-toggle .sidebar-caret {
        line-height: 1;
        transition: transform 160ms ease;
        transform-origin: 50% 45%;
        transform: translateY(-1px) rotate(0deg);
    }

    .gt-side-section-toggle[aria-expanded="false"] .sidebar-caret {
        transform: translateY(-1px) rotate(-90deg);
    }

@media (prefers-reduced-motion: reduce) {
    .gt-side-section-toggle .sidebar-caret {
        transition: none;
    }
}

/* Better label clipping */
.gt-side-link .gt-side-text {
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* <-- 2 lines */
    line-clamp: 2;
    white-space: normal; /* allow wrapping within the clamp */
}

/* If your gt-side-link isn't display:flex already, it should be */
.gt-side-link {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* Smooth pin list refresh */
.gt-sidebar-pins {
    transition: opacity 140ms ease;
    will-change: opacity;
}

    .gt-sidebar-pins.is-refreshing {
        opacity: 0;
    }

@media (prefers-reduced-motion: reduce) {
    .gt-sidebar-pins {
        transition: none;
    }
}

.gt-bmk-row .dropdown-toggle::after {
    display: none;
}

/* =========================================================
   Sidebar pins – canonical (scoped)
   Markup: _SidebarPins.cshtml
   #gtSidebar .gt-sidebar-pins (bucket) -> .gt-sidebar-pins-list -> .gt-side-pin rows
   ========================================================= */

/* Smooth pin list refresh */
#gtSidebar .gt-sidebar-pins {
    transition: opacity 140ms ease;
    will-change: opacity;
}

    #gtSidebar .gt-sidebar-pins.is-refreshing {
        opacity: 0;
    }

@media (prefers-reduced-motion: reduce) {
    #gtSidebar .gt-sidebar-pins {
        transition: none;
    }
}

/* Pins list layout */
#gtSidebar .gt-sidebar-pins-list {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin: 0;
    padding: 0;
}

/* Base row layout:
   - drag column is 0px by default (even in edit mode, until hover)
   - unpin column is 0px by default (until hover/focus)
*/
#gtSidebar .gt-side-pin {
    display: grid;
    grid-template-columns: 0px 1fr 0px; /* drag | link | unpin */
    align-items: center;
    column-gap: .35rem;
    padding: .2rem .25rem;
    border-radius: .6rem;
    transition: background-color 120ms ease, grid-template-columns 120ms ease, column-gap 120ms ease;
}

    #gtSidebar .gt-side-pin:hover {
        background: rgba(0,0,0,.04);
    }

    /* Keep children pinned to columns */
    #gtSidebar .gt-side-pin > .gt-pin-drag {
        grid-column: 1;
        overflow: hidden;
    }

    #gtSidebar .gt-side-pin > a.gt-side-link {
        grid-column: 2;
        min-width: 0;
    }

    #gtSidebar .gt-side-pin > .gt-side-unpin {
        grid-column: 3;
        overflow: hidden;
    }

    /* Link content for pin rows */
    #gtSidebar .gt-side-pin > a.gt-side-link {
        display: grid;
        grid-template-columns: 22px 1fr;
        align-items: center;
        column-gap: .5rem;
        padding: .35rem .5rem;
        margin: 0;
        border-radius: .45rem;
        min-width: 0;
        width: 100%;
    }

        /* Override global icon width rule for pins */
        #gtSidebar .gt-side-pin > a.gt-side-link i {
            width: 22px;
            text-align: center;
        }

    /* Pin text truncation */
    #gtSidebar .gt-side-pin .gt-side-text {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Button sizing (when visible) */
    #gtSidebar .gt-side-pin > .btn.gt-pin-drag,
    #gtSidebar .gt-side-pin > .btn.gt-side-unpin {
        width: 28px;
        height: 28px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 8px;
    }

/* ───────── NORMAL MODE (not editing) ───────── */
#gtSidebar .gt-pin-drag {
    display: none !important;
}

/* Unpin: hover-only in normal mode */
#gtSidebar .gt-side-pin .gt-side-unpin {
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}

#gtSidebar .gt-side-pin:hover .gt-side-unpin,
#gtSidebar .gt-side-pin:focus-within .gt-side-unpin {
    opacity: .95;
    pointer-events: auto;
}

/* Fix “thumbtack indent” in normal mode:
   - drag col is 0px, BUT its gap still shows; kill it when not editing
*/
body:not(.gt-sidebar-edit) #gtSidebar .gt-side-pin {
    column-gap: 0;
    padding-left: .15rem;
}

    body:not(.gt-sidebar-edit) #gtSidebar .gt-side-pin > a.gt-side-link {
        padding-left: .25rem;
    }

/* Empty list collapses fully in normal mode (no blank drop zone) */
#gtSidebar .gt-sidebar-pins-list.is-empty {
    min-height: 0;
    padding: 0;
}

/* ───────── EDIT MODE ───────── */
/* In edit mode, we only “reserve” the drag gutter on hover/focus,
   so the pin (thumbtack + text) sits flush-left until you aim at it. */
body.gt-sidebar-edit #gtSidebar .gt-side-pin {
    grid-template-columns: 0px 1fr 0px;
}

    /* On hover/focus: open the gutters */
    body.gt-sidebar-edit #gtSidebar .gt-side-pin:hover,
    body.gt-sidebar-edit #gtSidebar .gt-side-pin:focus-within {
        grid-template-columns: 28px 1fr 28px;
        column-gap: .35rem;
    }

/* Show drag handle in edit mode (but only visible when the gutter exists) */
body.gt-sidebar-edit #gtSidebar .gt-pin-drag {
    display: inline-flex !important;
    cursor: grab;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}

/* In edit mode, both controls are hover/focus-only */
body.gt-sidebar-edit #gtSidebar .gt-side-pin:hover .gt-pin-drag,
body.gt-sidebar-edit #gtSidebar .gt-side-pin:hover .gt-side-unpin,
body.gt-sidebar-edit #gtSidebar .gt-side-pin:focus-within .gt-pin-drag,
body.gt-sidebar-edit #gtSidebar .gt-side-pin:focus-within .gt-side-unpin {
    opacity: .95;
    pointer-events: auto;
}

/* Dragging cursor polish */
body.gt-sidebar-edit #gtSidebar .gt-side-pin.sorting .gt-pin-drag,
#gtSidebar .gt-side-pin.sorting .gt-pin-drag {
    cursor: grabbing;
}

/* Edit mode empty bucket: real drop target, but quiet until hovered */
body.gt-sidebar-edit #gtSidebar .gt-sidebar-pins-list.is-empty {
    min-height: 18px;
}

    body.gt-sidebar-edit #gtSidebar .gt-sidebar-pins-list.is-empty::before {
        content: "";
        display: none;
    }

    body.gt-sidebar-edit #gtSidebar .gt-sidebar-pins-list.is-empty:hover::before,
    body.gt-sidebar-edit #gtSidebar .gt-sidebar-pins-list.is-empty:focus-within::before {
        content: "Drop here";
        display: block;
        font-size: .75rem;
        color: var(--gt-text-muted);
        padding: .2rem .5rem;
        opacity: .6;
        pointer-events: none;
    }

/* Placeholder */
#gtSidebar .gt-side-pin-placeholder {
    height: 34px;
    border: 1px dashed var(--gt-border);
    border-radius: 8px;
}

/* ───────── COLLAPSED SIDEBAR (icon-only) ───────── */
#gtSidebar.gt-sidebar.collapsed .gt-side-pin {
    grid-template-columns: 1fr !important;
    padding: 0;
    border-radius: 10px;
}

#gtSidebar.gt-sidebar.collapsed .gt-pin-drag,
#gtSidebar.gt-sidebar.collapsed .gt-side-unpin,
#gtSidebar.gt-sidebar.collapsed .gt-side-text {
    display: none !important;
}

#gtSidebar.gt-sidebar.collapsed .gt-side-pin > a.gt-side-link {
    grid-column: auto !important;
    height: 40px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

#gtSidebar.gt-sidebar.collapsed .gt-side-pin:hover {
    background: rgba(0,0,0,.04);
}

#gtSidebar.gt-sidebar.collapsed .gt-side-pin > a.gt-side-link i {
    width: auto !important;
    font-size: 1.15rem;
    line-height: 1;
}

/* Sidebar: Add Folder button should ONLY show in edit mode */
#gtSidebar .gt-sidebar-add-btn {
    display: none !important;
}

body.gt-sidebar-edit #gtSidebar .gt-sidebar-add-btn {
    display: inline-flex !important;
}

/* ===================================================================
   GT DARK-ISH THEME SHIM
   Applies "dark" styling rules to any theme that maps to bs-theme="dark"
   (dark, mid, ocean, forest, blues).
   Paste at end of file.
   =================================================================== */

/* Form controls */
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] .input-group-text {
    background-color: var(--gt-surface) !important;
    color: var(--gt-text) !important;
    border-color: var(--gt-border) !important;
}

    html[data-bs-theme="dark"] .form-control::placeholder {
        color: var(--gt-text-muted) !important;
    }

/* Cards / headers that were hard-coded for dark only */
html[data-bs-theme="dark"] .card-header.bg-body {
    background-color: rgba(255,255,255,0.04) !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
}

/* Tables (general bootstrap tables) */
html[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--gt-bg-2);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-striped-color: #fff;
    --bs-table-border-color: rgba(255, 255, 255, 0.1);
    --bs-table-color: var(--gt-text);
}

    html[data-bs-theme="dark"] .table thead th {
        color: #f3f4f6;
        border-bottom-color: rgba(255, 255, 255, 0.15);
    }

    html[data-bs-theme="dark"] .table td,
    html[data-bs-theme="dark"] .table th {
        border-color: rgba(255, 255, 255, 0.1);
    }

/* DataTables 2.x (length, search, info, paging) */
html[data-bs-theme="dark"] .dt-container {
    color: #e2e8f0;
}

    html[data-bs-theme="dark"] .dt-container .dt-length label {
        color: #e2e8f0;
    }

    html[data-bs-theme="dark"] .dt-container .dt-length select {
        background-color: #1e293b;
        color: #e2e8f0;
        border: 1px solid #334155;
    }

    html[data-bs-theme="dark"] .dt-container .dt-search label {
        color: #e2e8f0;
    }

    html[data-bs-theme="dark"] .dt-container .dt-search input {
        background-color: #1e293b !important;
        color: #e2e8f0 !important;
        border: 1px solid #334155 !important;
    }

    html[data-bs-theme="dark"] .dt-container .dt-info {
        color: #94a3b8;
    }

    html[data-bs-theme="dark"] .dt-container .dt-paging .dt-paging-button {
        color: #e2e8f0 !important;
        background: none !important;
        border: 1px solid transparent !important;
    }

        html[data-bs-theme="dark"] .dt-container .dt-paging .dt-paging-button:hover {
            background-color: #1e293b !important;
            border-color: #334155 !important;
            color: #ffffff !important;
        }

        html[data-bs-theme="dark"] .dt-container .dt-paging .dt-paging-button.current,
        html[data-bs-theme="dark"] .dt-container .dt-paging .dt-paging-button.current:hover {
            background-color: #334155 !important;
            border-color: #475569 !important;
            color: #ffffff !important;
        }

        html[data-bs-theme="dark"] .dt-container .dt-paging .dt-paging-button.disabled {
            color: #475569 !important;
        }

    /* DataTables pagination (Bootstrap pager) */
    html[data-bs-theme="dark"] .dt-container .dt-paging .pagination .page-link {
        background-color: var(--gt-bg) !important;
        color: #e2e8f0 !important;
        border-color: rgba(255,255,255,0.08) !important;
    }

        html[data-bs-theme="dark"] .dt-container .dt-paging .pagination .page-link:hover {
            background-color: rgba(255,255,255,0.06) !important;
            color: #ffffff !important;
            border-color: rgba(255,255,255,0.12) !important;
        }

    html[data-bs-theme="dark"] .dt-container .dt-paging .pagination .page-item.active .page-link {
        background-color: var(--gt-accent) !important;
        color: #ffffff !important;
        border-color: var(--gt-accent) !important;
    }

    html[data-bs-theme="dark"] .dt-container .dt-paging .pagination .page-item.disabled .page-link {
        background-color: var(--gt-bg) !important;
        color: rgba(226,232,240,0.45) !important;
        border-color: rgba(255,255,255,0.08) !important;
    }

/* Toastr: apply your dark-mode toast styling to all dark-ish themes */
html[data-bs-theme="dark"] #toast-container > .toast-success {
    background-color: #12341d !important;
    border-color: #1f9d55 !important;
}

html[data-bs-theme="dark"] #toast-container > .toast-info {
    background-color: #0d3045 !important;
    border-color: #3298db !important;
}

html[data-bs-theme="dark"] #toast-container > .toast-warning {
    background-color: #3a2d09 !important;
    border-color: #d97706 !important;
}

html[data-bs-theme="dark"] #toast-container > .toast-error {
    background-color: #3a0d0d !important;
    border-color: #ef4444 !important;
}

.ts-control.form-control,
.ts-control.form-select {
    min-height: calc(1.5em + .5rem + 2px); /* match .form-select-sm-ish */
    padding-bottom: .25rem;
}

.ts-control .item i {
    opacity: .9;
}

/* Make Tom Select match Bootstrap small controls */
.ts-wrapper.form-select-sm .ts-control,
.ts-wrapper.form-control-sm .ts-control {
    padding: .25rem .5rem;
    font-size: .875rem;
}

    .ts-wrapper.form-select-sm .ts-control input {
        font-size: .875rem;
    }

.gt-ft-chips .badge {
    font-size: .9rem;
}

.gt-ft-remove {
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.gt-privacy-masked {
    filter: blur(8px);
    transition: filter .15s ease;
}

.gt-footer-inner {
    min-height: 42px;
    padding: 6px 12px;
}

.gt-footer-right {
    flex: 0 1 auto;
    margin-left: auto;
}

.gt-rec-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(220, 53, 69, .35);
    background: rgba(220, 53, 69, .08);
    color: #b42318;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

    .gt-rec-status:hover {
        background: rgba(220, 53, 69, .14);
    }

.gt-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #dc3545;
    display: inline-block;
}

.gt-recorder-tools-summary {
    font-size: 12px;
    color: var(--bs-secondary-color, #6c757d);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

    .gt-recorder-tools-summary .gt-tool-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 999px;
        border: 1px solid rgba(0, 0, 0, .08);
        background: rgba(0, 0, 0, .03);
        color: inherit;
        cursor: pointer;
    }

        .gt-recorder-tools-summary .gt-tool-chip:hover {
            background: rgba(0, 0, 0, .08);
        }

        .gt-recorder-tools-summary .gt-tool-chip.is-privacy {
            border-color: rgba(220, 53, 69, .22);
            background: rgba(220, 53, 69, .08);
            color: #a61e2a;
        }

        .gt-recorder-tools-summary .gt-tool-chip.is-draw {
            border-color: rgba(255, 193, 7, .28);
            background: rgba(255, 193, 7, .10);
        }

        .gt-recorder-tools-summary .gt-tool-chip i {
            font-size: 12px;
            pointer-events: none;
        }

@media (max-width: 1200px) {
    .gt-footer-inner {
        align-items: flex-start !important;
    }

    .gt-footer-left,
    .gt-footer-right {
        width: 100%;
    }

    .gt-footer-right {
        justify-content: flex-start !important;
        margin-left: 0;
    }
}

.gt-recorder-tool-menu-btn {
    white-space: nowrap;
}

#gtHelpShortcutsPanel code {
    font-size: 11px;
}

.gt-recorder-tool-menu-btn.is-active {
    background-color: var(--bs-primary, #0d6efd);
    color: #fff;
    border-color: var(--bs-primary, #0d6efd);
}

.gt-recorder-tool-menu-btn.is-accent {
    background-color: rgba(255, 193, 7, .18);
    border-color: rgba(255, 193, 7, .55);
    color: inherit;
}

.gt-recorder-tool-menu-btn.is-danger {
    background-color: rgba(220, 53, 69, .12);
    border-color: rgba(220, 53, 69, .45);
    color: #a61e2a;
}

.gt-recorder-tool-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gt-recorder-tool-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, .08);
    background: transparent;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: left;
    font-size: 14px;
}

    .gt-recorder-tool-row:hover {
        background: rgba(0, 0, 0, .035);
    }

.gt-recorder-tool-row-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.gt-recorder-tool-row-state {
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .1);
    background: rgba(0, 0, 0, .035);
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
}

.gt-recorder-tool-row.is-active {
    border-color: rgba(13, 110, 253, .35);
    background: rgba(13, 110, 253, .08);
}

    .gt-recorder-tool-row.is-active .gt-recorder-tool-row-state {
        border-color: rgba(13, 110, 253, .35);
        background: rgba(13, 110, 253, .14);
        color: #0d6efd;
    }

.gt-recorder-tool-row.is-accent {
    border-color: rgba(255, 193, 7, .42);
    background: rgba(255, 193, 7, .10);
}

    .gt-recorder-tool-row.is-accent .gt-recorder-tool-row-state {
        border-color: rgba(255, 193, 7, .45);
        background: rgba(255, 193, 7, .14);
        color: #8a6500;
    }

.gt-recorder-tool-row.is-danger {
    border-color: rgba(220, 53, 69, .35);
    background: rgba(220, 53, 69, .08);
}

    .gt-recorder-tool-row.is-danger .gt-recorder-tool-row-state {
        border-color: rgba(220, 53, 69, .35);
        background: rgba(220, 53, 69, .12);
        color: #b42318;
    }

.gt-recorder-tools-summary,
.gt-recorder-tools-summary .gt-tool-chip {
    pointer-events: auto;
}

.gt-help-collapse-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(13, 110, 253, .35);
    background: rgba(13, 110, 253, .08);
    border-radius: 10px;
    padding: 8px 10px;
    text-align: left;
    color: inherit;
}

    .gt-help-collapse-toggle:hover {
        background: rgba(13, 110, 253, .12);
    }

    .gt-help-collapse-toggle .fa-chevron-up,
    .gt-help-collapse-toggle .fa-chevron-down {
        transition: transform .15s ease;
    }

.gt-chat-user-item {
    position: relative;
}

.gt-chat-user-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    flex: 0 0 auto;
}

.gt-chat-user-action-btn {
    border: 0;
    background: transparent;
    color: #6b7280;
    padding: 0.2rem 0.35rem;
    border-radius: 6px;
    line-height: 1;
}

    .gt-chat-user-action-btn:hover {
        background: rgba(0, 0, 0, 0.06);
        color: #111827;
    }

.gt-chat-dropdown-footer .btn {
    white-space: nowrap;
}

#mdlFilePreview .modal-content {
    overflow: hidden;
}

#filePreviewFrame {
    background: #fff;
}

#gtFilePreviewModal.preview-unsupported #gtFilePreviewFrame {
    display: none !important;
}

#gtFilePreviewModal.preview-unsupported .modal-body {
    min-height: 280px;
}

#gtFilePreviewUnsupported {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gt-preview-pane {
    height: 75vh;
    background: var(--bs-body-bg);
}

.gt-preview-image-pane,
.gt-preview-text-pane {
    overflow: auto;
}

#gtFilePreviewPdfWrap {
    overflow: hidden;
}

.gt-preview-object {
    width: 100%;
    height: 75vh;
    border: 0;
    display: block;
}

.gt-preview-image-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.gt-preview-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
}

.gt-preview-object {
    width: 100%;
    height: 75vh;
    border: 0;
}

.gt-preview-text-pane {
    background: var(--bs-body-bg);
}

#gtFilePreviewText {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .875rem;
}

.mini-file-flag-btn {
    cursor: pointer;
    border: 1px solid var(--bs-border-color);
}

    .mini-file-flag-btn:hover {
        filter: brightness(.95);
    }

.mini-file-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.mini-file-cabinet .card-body {
    overflow: visible;
}

.mini-file-cabinet {
    overflow: visible;
}

.gc-portal-root--modal > .gc-modal-overlay {
    z-index: 3000 !important;
}

.gc-portal-root--modal {
    z-index: 3001 !important;
}

.gc-portal-root {
    z-index: 3000 !important;
}

.gt-pdf-modal-dialog {
    width: min(92vw, 1500px);
    max-width: none;
    height: calc(95vh - 72px);
    margin-top: .25rem;
    margin-bottom: 56px; /* keeps it above your status bar area */
}

    .gt-pdf-modal-dialog .modal-content {
        height: 100%;
        max-height: 100%;
    }

    .gt-pdf-modal-dialog .modal-body {
        height: 100%;
        overflow: hidden;
        padding: 0;
    }

#gtFileRedactorHost {
    height: 100%;
    min-height: 0;
}

#gtFilePreviewSpreadsheetWrap {
    overflow: auto;
    max-width: 100%;
    max-height: 70vh;
}

.gt-spreadsheet-preview-inner {
    width: 100%;
    overflow: auto;
}

#gtSpreadsheetPreviewTable {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: collapse;
}

    #gtSpreadsheetPreviewTable td,
    #gtSpreadsheetPreviewTable th {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 300px;
    }

#gtFilePreviewModal .modal-dialog {
    max-width: min(1400px, 95vw);
}

#gtFilePreviewModal .modal-body {
    overflow: hidden;
}

#gtFilePreviewDownloadLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#gtFilePreviewRichWrap {
    max-height: 75vh;
}

.gt-preview-table {
    font-size: .875rem;
}

    .gt-preview-table td,
    .gt-preview-table th {
        white-space: nowrap;
        max-width: 320px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.gt-markdown-preview {
    max-width: 900px;
    margin: 0 auto;
}

.gt-eml-preview pre,
.white-space-pre-wrap {
    white-space: pre-wrap;
    font-family: inherit;
}

.case-reaction-btn.reacted-by-me {
    background: var(--bs-tertiary-bg);
    border-color: var(--gt-accent);
    color: var(--bs-body-color);
    box-shadow: inset 0 0 0 1px var(--gt-accent);
    font-weight: 600;
}

.gt-notification-dropdown {
    width: 380px;
    max-height: 600px;
    overflow: hidden;
}

.gt-notification-list {
    max-height: 450px;
    overflow-y: auto;
}

.gt-notification-item {
    transition: background-color .15s ease;
}

    .gt-notification-item:hover {
        background-color: rgba(255,255,255,.05);
    }

.gt-notification-unread {
    background-color: rgba(var(--bs-primary-rgb), .08);
}

.gt-notification-page-unread {
    background-color: rgba(var(--bs-primary-rgb), .06);
    border-left: 4px solid var(--bs-primary);
}

.gt-mention {
    background: rgba(var(--bs-primary-rgb), .12);
    color: var(--bs-primary);
    border-radius: .4rem;
    padding: 0 .25rem;
    font-weight: 600;
}

.case-discussion-message {
    scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.gt-mention-menu {
    position: absolute;
    z-index: 1050;
    min-width: 16rem;
    max-height: 14rem;
    overflow-y: auto;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    margin-top: .25rem;
}

[data-discussion-editor],
[data-inline-reply-editor] {
    position: relative;
}

.badge-pending {
    font-size: .65rem;
    padding: .15rem .4rem;
}

.case-member-chip.pending {
    width: auto;
    max-width: 350px;
}

.gt-modal-xxl {
    width: min(1600px, 95vw);
    max-width: none;
}

.modal-dialog-scrollable .modal-content {
    max-height: 100% !important;
}

#caseActivityHistoryTable th.dt-type-numeric,
#caseActivityHistoryTable th.dt-type-date {
    text-align: left !important;
}

    #caseActivityHistoryTable th.dt-type-numeric div.dt-column-header,
    #caseActivityHistoryTable th.dt-type-date div.dt-column-header {
        flex-direction: row !important;
        justify-content: space-between !important;
    }

#caseActivityHistoryTable td.dt-type-numeric,
#caseActivityHistoryTable td.dt-type-date,
#caseActivityHistoryTable th.dt-type-numeric,
#caseActivityHistoryTable th.dt-type-date {
    text-align: left !important;
}

.case-history-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr)) minmax(190px, 1.4fr);
    gap: .75rem;
}

.case-history-summary-card {
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    padding: .75rem .9rem;
    background: var(--bs-body-bg);
}

    .case-history-summary-card .label {
        font-size: .75rem;
        color: var(--bs-secondary-color);
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .case-history-summary-card .value {
        font-size: 1.25rem;
        font-weight: 700;
        line-height: 1.2;
    }

        .case-history-summary-card .value.small {
            font-size: .95rem;
        }

.gt-release-details-modal {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .28), 0 .25rem .75rem rgba(0, 0, 0, .12);
}

    .gt-release-details-modal .modal-header {
        background: var(--bs-tertiary-bg);
        border-bottom: 1px solid var(--bs-border-color);
    }

    .gt-release-details-modal .modal-body {
        background: color-mix( in srgb, var(--bs-tertiary-bg) 35%, var(--bs-body-bg) );
    }

    .gt-release-details-modal .modal-footer {
        background: var(--bs-tertiary-bg);
    }

.gt-release-details-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    font-size: 1rem;
}