﻿/* ============================================================
   CURO — MODERN UI THEME
   Loaded last so it overrides legacy styles.
   ============================================================ */

:root {
    --brand: #1e6fd9;
    --brand-dark: #1857ab;
    --brand-light: #e8f1fd;
    --accent: #00b8a9;
    --danger: #e5484d;
    --warning: #f59e0b;
    --success: #16a34a;
    --ink: #1a2233;
    --ink-soft: #5b6879;
    --ink-faint: #8b97a8;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --line: #e3e8ef;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
    --shadow-md: 0 4px 12px rgba(16,24,40,.08);
    --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
    --ring: 0 0 0 3px rgba(30,111,217,.18);
    --font: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Base ---------- */
html {
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color .15s ease;
}

    a:hover {
        color: var(--brand-dark);
        text-decoration: underline;
    }

/* ---------- Layout shell ---------- */
.page {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px 40px;
    background: transparent;
    border: none;
}

/* ---------- Header ---------- */
.header {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin: 20px 0 18px;
    padding: 0;
    overflow: visible;
    height: auto;
}

    .header .title {
        margin: 0;
        padding: 0;
    }

        .header .title h1 {
            display: none;
        }

/* Top bar inside header: banner + user block */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
}

/* Banner / tenant logo area (background-image is injected in code-behind) */
.loginDisplay {
    flex: 1 1 260px;
    min-height: 64px;
    min-width: 220px;
    background-position: left center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    color: var(--ink-soft);
    font-size: 13px;
    text-align: left;
    margin: 0;
    padding: 0;
}

    .loginDisplay br {
        display: none;
    }

    .loginDisplay a {
        color: var(--brand);
        font-weight: 600;
    }

/* User chip */
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--brand-light);
    border: 1px solid #d3e4fb;
    color: var(--brand-dark);
    border-radius: 999px;
    padding: 7px 16px 7px 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

    .user-chip .avatar {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: var(--brand);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 700;
    }

    .user-chip .bold {
        font-weight: 700;
    }

/* License / status pill */
.license-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b42318 !important;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
}

    .license-pill:empty {
        display: none;
    }

    .license-pill strong {
        font-weight: 600;
    }

/* Return-to-dashboard button */
.dashboard-nav-container {
    float: none !important;
    margin: 0 !important;
}

.btn-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-soft) !important;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all .18s ease;
    white-space: nowrap;
}

    .btn-dashboard:hover {
        background: var(--brand-light);
        border-color: #cadffb;
        color: var(--brand-dark) !important;
        text-decoration: none;
        transform: translateY(-1px);
    }

/* ---------- Navigation menu ---------- */
.hideSkiplink {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    width: 100%;
}

.menu, .menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu {
    display: flex;
    width: 100%;
    gap: 4px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-radius: 0 0 var(--radius) var(--radius);
    margin: 0;
    box-sizing: border-box;
}

    .menu > ul {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
        gap: 4px;
    }

        .menu > ul > li {
            flex: 0 0 auto;
        }

    .menu ul li a,
    .menu ul li a:link,
    .menu ul li a:visited {
        display: block;
        padding: 11px 20px;
        border-radius: var(--radius-sm);
        color: #ffffff !important;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: .1px;
        text-decoration: none !important;
        background: transparent !important;
        border: none !important;
        transition: all .18s ease;
        white-space: nowrap;
    }

        .menu ul li a:hover {
            background: rgba(255,255,255,.18) !important;
            color: #ffffff !important;
            transform: translateY(-1px);
        }

        /* Selected / active menu item */
        .menu ul li a.selected,
        .menu ul li a.static.selected,
        .menu ul li.selected > a {
            background: #ffffff !important;
            color: var(--brand-dark) !important;
            box-shadow: 0 2px 8px rgba(0,0,0,.18);
        }

        /* Flyout submenus */
        .menu ul li ul {
            position: absolute;
            top: 100%;
            left: 0;
            min-width: 200px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            box-shadow: var(--shadow-lg);
            padding: 6px;
            z-index: 500;
        }

/* ---------- Main content ---------- */
.main {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
}

/* ---------- Cards / section panels ---------- */
.secBorder,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
    margin-bottom: 18px;
    transition: box-shadow .2s ease;
}

    .secBorder:hover {
        box-shadow: var(--shadow-md);
    }

/* Page heading strip */
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 4px 0 16px;
}

    .page-heading h2 {
        margin: 0;
        font-size: 21px;
        font-weight: 700;
        letter-spacing: -.2px;
        color: var(--ink);
    }

    .page-heading .sub {
        color: var(--ink-faint);
        font-size: 13px;
        margin-top: 2px;
    }

/* ---------- Form grid (legacy col* classes) ---------- */
.colHeading2, .colHeading5 {
    float: left;
    width: 150px;
    padding: 10px 12px 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    letter-spacing: .1px;
}

.colDetail1, .colDetail5, .colDetail6 {
    float: left;
    padding: 6px 24px 6px 0;
}

.colDetailWide, .colDetailWide1, .colDetailWide4 {
    float: left;
    padding: 6px 0;
}

.colDetailWideBorder {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    background: #fbfcfe;
}

.clear {
    clear: both;
    height: 0;
    line-height: 0;
    font-size: 0;
}

/* ---------- Inputs ---------- */
input[type=text], input[type=password], input[type=email],
input[type=number], textarea, select,
.input, .inputWide, .select, .selectWide {
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #d5dbe5;
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
    box-shadow: 0 1px 1px rgba(16,24,40,.03);
}

.input, .select {
    width: 230px;
}

.inputWide, .selectWide {
    width: 100%;
    max-width: 640px;
}

input[type=text]:hover, textarea:hover, select:hover {
    border-color: #bcc7d6;
}

input[type=text]:focus, input[type=password]:focus, input[type=email]:focus,
textarea:focus, select:focus {
    border-color: var(--brand);
    box-shadow: var(--ring);
    background: #fff;
}

input[readonly], input:disabled, select:disabled, textarea:disabled {
    background: aliceblue;
    color: var(--ink-faint);
    cursor: not-allowed;
}

textarea {
    min-height: 90px;
    resize: vertical;
    line-height: 1.6;
}

/* Checkboxes */
input[type=checkbox], input[type=radio] {
    width: 17px;
    height: 17px;
    accent-color: var(--brand);
    vertical-align: middle;
    cursor: pointer;
}

/* Validators */
.rfv {
    display: inline-block;
    color: var(--danger) !important;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* Datepicker calendar icon */
img.ui-datepicker-trigger {
    vertical-align: middle;
    margin-left: 8px;
    cursor: pointer;
    opacity: .65;
    transition: opacity .15s ease, transform .15s ease;
}

    img.ui-datepicker-trigger:hover {
        opacity: 1;
        transform: scale(1.08);
    }

/* ---------- Buttons ---------- */
.button,
input[type=submit], input[type=button], button {
    font-family: var(--font);
    font-size: 14px !important;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    border: 1px solid var(--brand-dark);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16,24,40,.10);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

    .button:hover,
    input[type=submit]:hover, input[type=button]:hover, button:hover {
        filter: brightness(1.07);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(30,111,217,.28);
    }

    .button:active {
        transform: translateY(0);
    }

    .button:disabled, input:disabled[type=submit] {
        background: #cfd6e0;
        border-color: #cfd6e0;
        color: #fff;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* Secondary button variant */
.button-secondary {
    background: var(--surface) !important;
    color: var(--ink-soft) !important;
    border: 1px solid var(--line) !important;
}

    .button-secondary:hover {
        background: var(--brand-light) !important;
        color: var(--brand-dark) !important;
    }


/* ---------- Grids / tables ---------- */
table.gridview, .gridview, table[id*="gv"] {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: 13.5px;
}

    table[id*="gv"] th,
    table.modern-grid .grid-header th {
        background: linear-gradient(180deg, #eef4fc 0%, #e2ecf8 100%);
        color: var(--brand-dark);
        font-weight: 800;
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: .6px;
        padding: 14px 16px;
        text-align: left;
        border: none;
        border-bottom: 2px solid var(--brand);
        white-space: nowrap;
    }

        table[id*="gv"] th:first-child {
            border-top-left-radius: var(--radius);
        }

        table[id*="gv"] th:last-child {
            border-top-right-radius: var(--radius);
        }

        table[id*="gv"] th a,
        table.modern-grid .grid-header th a {
            color: var(--brand-dark) !important;
        }

    table[id*="gv"] td {
        padding: 11px 14px;
        border-bottom: 1px solid #eef1f6;
        color: var(--ink);
        vertical-align: middle;
    }

    table[id*="gv"] tr:last-child td {
        border-bottom: none;
    }

    table[id*="gv"] tr:hover td {
        background: #f8fafd;
    }

/* ---------- Footer ---------- */
.footer {
    margin-top: 26px;
    padding: 18px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

#footercont {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

#footerleft img {
    display: block;
    opacity: .9;
}

#footerright {
    color: var(--ink-faint);
    font-size: 12.5px;
}

#bottomcont, #bottom {
    height: 0;
    overflow: hidden;
}

/* ---------- Utility ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .3px;
}

.badge-open {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-closed {
    background: #dcfce7;
    color: #15803d;
}

.badge-overdue {
    background: #fee2e2;
    color: #b91c1c;
}

/* ---------- Centered loading indicator (BlockUILoading) ---------- */
.curo-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 180px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.curo-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid var(--brand-light);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: curo-spin .8s linear infinite;
}

.curo-loading-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    letter-spacing: .3px;
}

@keyframes curo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   TICKET PAGE + LAYOUT REFINEMENTS
   ============================================================ */

/* ---------- 1. Full-width cards, aligned to the header ---------- */
#divTicketContainer,
#divTicketCreatorSummary,
#divTicketHeaderSummary,
#divTicketDetailSummary,
#divTicketDetail,
#divTicketDetailContainer,
.main > div,
.secBorder {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* Kill legacy fixed widths that made cards narrower than the header */
#divTicketContainer { padding: 0 !important; border: none !important; background: transparent !important; }

/* UpdatePanels shouldn't constrain width */
#updSystemTicketType, #updTicketDetailFields2,
#updLinkTicket, #updTicketDetailButtons, #updMapContainer {
    display: block;
    width: 100%;
}

/* ---------- 2. Modern card layout — aligned label/field grid ---------- */
.secBorder {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 4px;
    column-gap: 0;
    padding: 24px 26px !important;
}

/* Labels */
.secBorder > .colHeading2,
.secBorder > .colHeading5 {
    flex: 0 0 150px;
    float: none !important;
    width: 150px;
    padding: 8px 14px 8px 0;
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: .4px;
    line-height: 1.4;
}

/* Standard fields — two per row */
.secBorder > .colDetail1,
.secBorder > .colDetail5,
.secBorder > .colDetail6 {
    flex: 0 1 300px;
    float: none !important;
    padding: 6px 32px 6px 0;
    margin: 0;
    min-width: 0;
}

/* Wide fields — take the rest of the row */
.secBorder > .colDetailWide,
.secBorder > .colDetailWide1,
.secBorder > .colDetailWide4 {
    flex: 1 1 460px;
    float: none !important;
    padding: 6px 0;
    margin: 0;
    min-width: 0;
}

/* .clear becomes a row break inside the flex card */
.secBorder > .clear {
    flex: 0 0 100%;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

/* Card section title */
.secBorder > .card-title {
    flex: 0 0 100%;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.1px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.secBorder > .card-title::before {
    content: "";
    width: 4px; height: 16px;
    border-radius: 2px;
    background: var(--brand);
}

/* Fields fill their cell */
.secBorder .input,
.secBorder .select { width: 100%; max-width: 260px; }
.secBorder .inputWide,
.secBorder .selectWide { width: 100%; max-width: 100%; }

/* Ticket # literal in the header card */
#litTicketID {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand);
}

/* Read-only Issue Date literal */
#litIssueDate {
    display: inline-block;
    background: #f1f4f9;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-weight: 600;
    color: var(--ink-soft);
}

/* Character-remaining hint under Subject */
#remtxtSubject { font-weight: 700; color: var(--brand); }
.colDetailWide > div:has(#remtxtSubject),
#txtSubject + div { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }

/* WYSIWYG editor container */
.wysiwygtextbox, .wysiwyg {
    border: 1px solid #d5dbe5 !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
}

/* Button row inside cards */
.secBorder > .colDetail1 .button,
#updTicketDetailButtons .button { margin-right: 10px; }

/* ---------- 3. Menu bar — even height with its items ---------- */
.hideSkiplink {
    display: flex;
    align-items: stretch;
    min-height: 52px;
    padding: 0 12px;
}
.menu {
    display: flex;
    align-items: center;
    padding: 0;
    min-height: 52px;
    width: 100%;
}
.menu > ul {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 52px;
    margin: 0;
    padding: 0;
    width: 100%;
}
.menu ul li {
    display: flex;
    align-items: center;
    height: 100%;
    float: none !important;
}
.menu ul li a,
.menu ul li a:link,
.menu ul li a:visited {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 20px;
    line-height: 1;
}

/* Header banner strip height matches the nav strip */
.topbar { min-height: 84px; padding: 14px 22px; }
.loginDisplay { min-height: 56px; }

/* ---------- 4. Responsive ---------- */
@media (max-width: 1100px) {
    .secBorder > .colDetail1,
    .secBorder > .colDetail5,
    .secBorder > .colDetail6 { flex: 1 1 260px; }
}
@media (max-width: 820px) {
    .secBorder { padding: 18px !important; }
    .secBorder > .colHeading2,
    .secBorder > .colHeading5 { flex: 0 0 100%; width: 100%; padding-bottom: 2px; }
    .secBorder > .colDetail1,
    .secBorder > .colDetail5,
    .secBorder > .colDetail6,
    .secBorder > .colDetailWide,
    .secBorder > .colDetailWide1 { flex: 0 0 100%; padding-right: 0; }
    .secBorder .input, .secBorder .select { max-width: 100%; }
    .hideSkiplink, .menu, .menu > ul { min-height: auto; height: auto; }
    .menu > ul { flex-wrap: nowrap; overflow-x: auto; padding: 8px 0; }
}

/* ============================================================
   CURO — MODERN DASHBOARD
   Loaded after modern-ui.css. Restyles existing controls only.
   ============================================================ */

/* ---------- Page heading ---------- */
.dash-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 6px 0 18px;
}
.dash-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--ink);
}
.dash-head .sub { color: var(--ink-faint); font-size: 13px; margin-top: 2px; }

/* ---------- KPI strip ---------- */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
    text-decoration: none !important;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cadffb;
    text-decoration: none !important;
}
.kpi-icon {
    width: 46px; height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.kpi-meta { display: flex; flex-direction: column; line-height: 1.2; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; }

.kpi-danger  .kpi-icon { background: #fee2e2; color: #b91c1c; }
.kpi-warning .kpi-icon { background: #fef3c7; color: #b45309; }
.kpi-info    .kpi-icon { background: #e0f2fe; color: #0369a1; }
.kpi-brand   .kpi-icon { background: var(--brand-light); color: var(--brand-dark); }
.kpi-success .kpi-icon { background: #dcfce7; color: #15803d; }
.kpi-danger.has-count  .kpi-value { color: #b91c1c; }

/* ---------- Two-column shell ---------- */
#divDashboadLeft {
    float: none !important;
    width: auto !important;
    display: block;
}
#divDashboardRight {
    float: none !important;
    width: 320px !important;
}
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
#divDashboardRight { position: sticky; top: 16px; }

/* ---------- Section cards (collapsible headers + bodies) ---------- */
.colHeadingWide, .colHeadingWide1 {
    background: var(--surface);
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 15px 20px;
    margin: 18px 0 0;
    box-shadow: var(--shadow-sm);
}
.colHeadingWide strong, .colHeadingWide1 strong { font-weight: 700; }
.colHeadingWide a, .colHeadingWide1 a {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink) !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.colHeadingWide a::before, .colHeadingWide1 a::before {
    content: "";
    width: 4px; height: 16px;
    border-radius: 2px;
    background: var(--brand);
}
/* Escalated header keeps its red accent */
#txtEscalatedHeader a { color: #b91c1c !important; }
#txtEscalatedHeader a::before { background: #e5484d; }

/* Count literal -> pill badge */
.colHeadingWide .litCount, .colHeadingWide1 .litCount { display: none; } /* handled by KPI; keep raw text subtle */

/* Section body cards (the collapsible divs that hold each grid) */
#divEscalated, #divAwaitAttention, #divTicketsLogged, #divAwaitAssignment,
#divAwaitApproval, #divWOAwaitApproval, #divWOAwaitClosure, #divWOAwaitRequote,
#divTicketsLoggedByUser, #divOverdueTicketApprovedByUser {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 8px 16px 16px;
    margin-bottom: 6px;
}
#divWODashboardInner { padding: 0; }

/* ---------- Grids ---------- */
.grid-header th {
    background: #f7f9fc !important;
    color: var(--ink-soft) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 11px 12px !important;
    border: none !important;
    border-bottom: 1px solid var(--line) !important;
    text-align: left;
}
.grid-alt1 td, .grid-alt2 td {
    padding: 10px 12px !important;
    border: none !important;
    border-bottom: 1px solid #eef1f6 !important;
    font-size: 13px;
    color: var(--ink);
}
.grid-alt2 td { background: #fbfcfe; }
.grid-alt1:hover td, .grid-alt2:hover td { background: #f2f7ff; }
table[id*="gv"] a {
    display: inline-block;
    padding: 4px 12px;
    background: var(--brand-light);
    color: var(--brand-dark) !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none !important;
}
table[id*="gv"] a:hover { background: #d6e6fb; }

/* ---------- Right sidebar cards ---------- */
#divAwayStatus {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    margin-bottom: 16px;
}
#divAwayStatus span { color: var(--ink-faint); }
#chkAway { font-size: 15px !important; font-weight: 700; color: var(--ink); }

#divTicketTree, #divTicketGraph {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    margin-bottom: 16px;
}
#divTicketTree img, #divDashboadLeft img[id*="cht"] { max-width: 100%; height: auto; border-radius: 8px; }

/* Charts in the left column */
#divDashboadLeft [id*="cht"], #divDashboadLeft .chart {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 10px;
    margin-top: 18px;
}

/* Filter panel */
#divTicketSearch {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#divTicketSearch::before {
    content: "Quick Filter";
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--ink-soft); margin-bottom: 2px;
}
#divTicketSearch br { display: none; }
.selectWide3 { width: 100% !important; }

/* Create button full-width in sidebar */
#btnNewTicket { width: 100%; margin-bottom: 16px; font-size: 14px !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .dash-grid { grid-template-columns: 1fr; }
    #divDashboardRight { width: 100% !important; position: static; }
}
/* ---------- Ticket tabs (jQuery UI) ---------- */
.ui-tabs, #divTicketDetailSummary {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

    #divTicketDetailSummary > ul, .ui-tabs .ui-tabs-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        list-style: none;
        margin: 0 0 16px;
        padding: 6px;
        background: #eef1f6;
        border-radius: var(--radius);
    }

        #divTicketDetailSummary > ul li, .ui-tabs .ui-tabs-nav li {
            float: none;
            margin: 0;
            border: none;
            background: transparent;
        }

            #divTicketDetailSummary > ul li a, .ui-tabs .ui-tabs-nav li a {
                display: block;
                padding: 11px 22px;
                color: var(--ink-soft);
                font-size: 13.5px;
                font-weight: 700;
                border: none;
                border-radius: var(--radius-sm);
                text-decoration: none;
                transition: all .16s ease;
            }

                #divTicketDetailSummary > ul li a:hover {
                    background: rgba(30,111,217,.08);
                    color: var(--brand-dark);
                }

            #divTicketDetailSummary > ul li.ui-tabs-active a,
            .ui-tabs .ui-tabs-nav li.ui-state-active a {
                background: var(--surface);
                color: var(--brand-dark) !important;
                box-shadow: var(--shadow-sm);
            }

    .ui-tabs .ui-tabs-panel,
    #divTicketDetailSummary > div {
        padding: 0;
        border: none;
        background: transparent;
    }

/* ---------- Ticket History: card per entry ---------- */
#divTicketHistory .colDetailWideBorder {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    margin-bottom: 16px;
}

    #divTicketHistory .colDetailWideBorder > div {
        padding: 4px 0;
    }

/* Label/value pairs inside history cards */
#divTicketHistory .colHeading2 {
    float: none;
    display: inline-block;
    width: 140px;
    vertical-align: top;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ink-faint);
}

#divTicketHistory .colDetail1,
#divTicketHistory .colDetail6 {
    float: none;
    display: inline-block;
    width: calc(50% - 150px);
    min-width: 160px;
    vertical-align: top;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

#divTicketHistory .clear {
    clear: both;
    height: 0 !important;
    line-height: 0;
    margin: 6px 0;
}

#divTicketHistory hr {
    display: none; /* replaced by card boundaries */
}

#divTicketHistory iframe {
    width: 100% !important;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    margin-top: 8px;
}

/* ---------- Ticket Detail tab: grouped cards, clear label/value ---------- */
#divTicketDetail .card-section,
#divTicketDetail > div[id] {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
    margin-bottom: 18px;
}

/* Generic label/value pattern for legacy col* controls anywhere inside tabs */
.ui-tabs .colHeading2,
.ui-tabs .colHeading5 {
    float: none;
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ink-faint);
    margin: 14px 0 6px;
}

.ui-tabs .colDetail1,
.ui-tabs .colDetail6,
.ui-tabs .colDetailWide,
.ui-tabs .colDetailWide1 {
    float: none;
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.ui-tabs .clear {
    clear: both;
    height: 0 !important;
    line-height: 0;
}

.ui-tabs hr {
    border: none;
    border-top: 1px dashed var(--line);
    margin: 18px 0;
}

.ui-tabs iframe {
    width: 100% !important;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

/* Two-column layout on wider screens for label/value groups */
@media (min-width: 760px) {
    #divTicketDetail .field-row {
        display: flex;
        flex-wrap: wrap;
        gap: 24px;
    }

        #divTicketDetail .field-row > div {
            flex: 1 1 240px;
        }
}

/* ---------- Card sections (Ticket Detail / Map / Works Order groups) ---------- */
.card-section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
    margin-bottom: 18px;
}

.card-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--brand-dark);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

/* ---------- Label / value field pairs (clear visual distinction) ---------- */
.field-pair {
    margin-bottom: 14px;
}

    .field-pair:last-child {
        margin-bottom: 0;
    }

    .field-pair .label {
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--ink-faint);
        margin-bottom: 4px;
    }

    .field-pair .value {
        font-size: 14px;
        font-weight: 600;
        color: var(--ink);
    }

    .field-pair.inline {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

        .field-pair.inline .label {
            margin-bottom: 0;
        }

    .field-pair.full .value {
        width: 100%;
    }

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    font-size: 13px;
    color: var(--ink-soft);
}

/* ---------- History cards (one card per ListView item) ---------- */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    transition: box-shadow .2s ease;
}

    .history-card:hover {
        box-shadow: var(--shadow-md);
    }

.history-card-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 12px;
}

    .history-card-row:last-child {
        margin-bottom: 0;
    }

    .history-card-row .field-pair {
        flex: 1 1 200px;
        margin-bottom: 0;
    }

    .history-card-row.full .field-pair {
        flex: 1 1 100%;
    }

.history-card iframe {
    width: 100% !important;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    margin-top: 6px;
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--ink-faint);
    font-size: 13.5px;
    background: #fbfcfe;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

/* ============================================================
   TICKET DETAIL TABS — MODERN STYLING
   ============================================================ */

/* Container & Nav Pill Bar */
.tt-tabs-container {
    margin-top: 18px;
}

#divTicketDetailSummary > ul.tt-tabs-nav,
.ui-tabs .ui-tabs-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    background: #e9eef6 !important;
    padding: 6px !important;
    border-radius: 12px !important;
    border: 1px solid #dbe3f0 !important;
    list-style: none !important;
    margin-bottom: 20px !important;
}

    #divTicketDetailSummary > ul.tt-tabs-nav li,
    .ui-tabs .ui-tabs-nav li {
        float: none !important;
        border: none !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
    }

        #divTicketDetailSummary > ul.tt-tabs-nav li a,
        .ui-tabs .ui-tabs-nav li a {
            display: inline-flex !important;
            align-items: center !important;
            padding: 10px 22px !important;
            border-radius: 8px !important;
            font-size: 13.5px !important;
            font-weight: 600 !important;
            color: #475569 !important;
            text-decoration: none !important;
            transition: all 0.18s ease !important;
            border: none !important;
            background: transparent !important;
        }

            #divTicketDetailSummary > ul.tt-tabs-nav li a:hover,
            .ui-tabs .ui-tabs-nav li a:hover {
                background: rgba(37, 99, 235, 0.08) !important;
                color: #1d4ed8 !important;
            }

        #divTicketDetailSummary > ul.tt-tabs-nav li.ui-tabs-active a,
        #divTicketDetailSummary > ul.tt-tabs-nav li.ui-state-active a,
        .ui-tabs .ui-tabs-nav li.ui-state-active a {
            background: #ffffff !important;
            color: #1e3a63 !important;
            font-weight: 700 !important;
            box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
        }

/* Tab Panels */
.tt-tab-panel {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Card Blocks inside Tabs */
.tt-card-block {
    background: #ffffff;
    border: 1px solid #e1e7f0;
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.tt-block-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e3a63;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e8edf5;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .tt-block-title::before {
        content: "";
        width: 4px;
        height: 14px;
        border-radius: 2px;
        background: #2563eb;
    }

/* Form Grid & Field Labels */
.tt-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.tt-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tt-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Action Toggles (Close, Approved, Escalate) */
.tt-action-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.tt-toggle-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .tt-toggle-card:hover {
        background: #eff6ff;
        border-color: #bfdbfe;
    }

    .tt-toggle-card input[type="checkbox"] {
        margin-top: 2px;
        width: 18px;
        height: 18px;
        accent-color: #2563eb;
    }

.tt-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tt-toggle-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
}

.tt-toggle-sub {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.3;
}

/* Inline Input helpers */
.tt-input-with-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tt-inline-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.tt-inline-input-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tt-link-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.tt-btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* History Timeline Cards */
.tt-history-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tt-history-item-card {
    background: #ffffff;
    border: 1px solid #e1e7f0;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.tt-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.tt-history-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tt-hist-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a63, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tt-hist-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
}

.tt-hist-date {
    font-size: 11.5px;
    color: #64748b;
}

.tt-hist-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 11.5px;
    font-weight: 700;
}

.tt-history-meta-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tt-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tt-meta-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.04em;
}

.tt-meta-value {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
}

.tt-iframe-wrap iframe {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
}

.tt-history-attachments {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.tt-attachment-content {
    font-size: 13px;
    color: #2563eb;
    margin-top: 4px;
}

.tt-map-viewer {
    width: 100%;
    height: 380px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    overflow: hidden;
}

.tt-empty-state {
    text-align: center;
    padding: 36px 16px;
    color: #94a3b8;
    font-size: 13.5px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tt-badge-yes {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 700;
    font-size: 11px;
}

.tt-badge-no {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 700;
    font-size: 11px;
}

.tt-textarea-readonly {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 12.5px;
    color: #475569;
    padding: 6px 8px;
    resize: none;
}

/* User Management */
#divUsers {
    background: #ffffff;
}

    #divUsers .um-heading {
        margin-bottom: 22px;
    }

        #divUsers .um-heading h2 {
            margin: 0;
            color: #172b4d;
            font-size: 22px;
        }

        #divUsers .um-heading p,
        #divUsers .um-card-heading p {
            margin: 5px 0 0;
            color: #64748b;
            font-size: 13px;
            line-height: 1.5;
        }

    #divUsers .um-card {
        margin-bottom: 20px;
        padding: 24px;
        border: 1px solid #dfe6ef;
        border-radius: 14px;
        background: var(--bg);
        box-shadow: 0 3px 12px rgba(23, 43, 77, .04);
    }

    #divUsers .um-selection {
        border-top: 3px solid #2f6fed;
    }

    #divUsers .um-card-heading {
        display: flex;
        align-items: center;
        gap: 12px;
       /* margin-bottom: 22px;
        padding-bottom: 16px;*/
        border-bottom: 1px solid #edf1f7;
    }

        #divUsers .um-card-heading h3 {
            margin: 0;
            font-size: 16px;
            color: #172b4d;
        }

    #divUsers .um-icon {
        display: inline-flex;
        flex: 0 0 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: #eaf1ff;
        color: #265dcc;
        font-size: 13px;
        font-weight: 700;
    }

    #divUsers .um-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    #divUsers .field-group {
        min-width: 0;
    }

        #divUsers .um-label,
        #divUsers .field-group > label:not(.um-option) {
            color: #475569;
            font-size: 12px;
            font-weight: 600;
            text-transform: none;
            letter-spacing: normal;
        }

    #divUsers .input,
    #divUsers .select {
        width: 100%;
        max-width: 100%;
        min-height: 42px;
        box-sizing: border-box;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
    }

    #divUsers .um-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        gap: 12px;
        margin-top: 22px;
    }

    #divUsers .um-option {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0;
        padding: 14px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #f8fafc;
        color: #334155;
        font-size: 13px;
        text-transform: none;
        letter-spacing: normal;
        cursor: pointer;
    }

        #divUsers .um-option input[type="checkbox"] {
            width: 17px;
            height: 17px;
            margin: 0;
            accent-color: #2f6fed;
        }

        #divUsers .um-option strong {
            display: block;
            font-weight: 600;
        }

        #divUsers .um-option small {
            display: block;
            margin-top: 4px;
            color: #64748b;
            font-size: 12px;
            font-weight: 400;
        }

    #divUsers .um-role-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
        align-items: center;
        gap: 16px;
    }

    #divUsers .um-role-box {
        min-width: 0;
        padding: 14px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #f8fafc;
    }

        #divUsers .um-role-box > label {
            display: block;
            margin-bottom: 12px;
            color: #475569;
            font-size: 13px;
            font-weight: 600;
        }

    #divUsers .um-role-assigned {
        border-color: #bfdbfe;
        background: #eff6ff;
    }

    #divUsers .transfer-listbox {
        width: 100% !important;
        height: 220px !important;
        box-sizing: border-box;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #fff;
        color: #334155;
        padding: 8px;
    }

        #divUsers .transfer-listbox option {
            padding: 8px;
        }

    #divUsers .um-role-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

   /* #divUsers .transfer-btn {
        width: 44px;
        min-height: 38px;
        margin: 0;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #fff;
        color: #265dcc;
        font-weight: 700;
        cursor: pointer;
    }

        #divUsers .transfer-btn:hover {
            border-color: #2f6fed;
            background: #eaf1ff;
        }*/

    #divUsers .um-save-bar {
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }

        #divUsers .um-save-bar > span {
            color: #64748b;
            font-size: 12px;
        }

    #divUsers input:focus-visible,
    #divUsers select:focus-visible {
        outline: 3px solid #93c5fd;
        outline-offset: 2px;
    }

@media (max-width: 900px) {
    #divUsers .um-fields,
    #divUsers .um-role-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    #divUsers .um-role-actions {
        flex-direction: row;
        justify-content: center;
    }

    #divUsers .um-card {
        padding: 16px;
    }
}
/* User menu: avatar chip + My Profile / Log Out links, connected beneath it */
.user-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.user-menu-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

    .user-menu-links a,
    .user-menu-links .user-menu-logout {
        color: var(--ink-soft) !important;
        font-weight: 600;
        text-decoration: none;
    }

        .user-menu-links a:hover,
        .user-menu-links .user-menu-logout:hover {
            color: var(--brand-dark) !important;
            text-decoration: underline;
        }

.user-menu-sep {
    color: var(--line);
}
/* Header right account section */
.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 1 auto;
    min-width: 280px;
}

.header-account-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    backdrop-filter: blur(8px);
}

.header-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 6px 14px rgba(30, 111, 217, .24);
    overflow: hidden;
}

    .header-avatar span {
        display: inline-block;
        max-width: 1ch;
        overflow: hidden;
    }

.header-account-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.header-account-label {
    color: var(--ink-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.header-account-name {
    max-width: 180px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-account-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
}

.header-action,
.header-action:link,
.header-action:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand-dark) !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all .18s ease;
}

    .header-action:hover {
        background: var(--brand-light);
        border-color: #cadffb;
        color: var(--brand-dark) !important;
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .header-action.primary {
        background: var(--brand);
        border-color: var(--brand);
        color: #fff !important;
    }

        .header-action.primary:hover {
            background: var(--brand-dark);
            color: #fff !important;
        }

    .header-action.danger {
        color: var(--danger) !important;
    }

        .header-action.danger:hover {
            background: #fef2f2;
            border-color: #fecaca;
            color: #b42318 !important;
        }

@media (max-width: 720px) {
    .topbar-right {
        width: 100%;
        justify-content: flex-start;
        min-width: 0;
    }

    .header-account-card {
        width: 100%;
        border-radius: var(--radius);
        flex-wrap: wrap;
    }

    .header-account-actions {
        width: 100%;
        padding-left: 50px;
    }
}

/* ============================================================
   AUTH / BASE PAGE MODERNIZATION
   ============================================================ */

.auth-master {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(30, 111, 217, .16), transparent 34%), radial-gradient(circle at bottom right, rgba(0, 184, 169, .14), transparent 30%), linear-gradient(135deg, #f4f7fb 0%, #eef3f9 100%);
}

.auth-page {
    width: 100%;
    max-width: 1180px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 22px 20px 28px;
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    margin-bottom: 22px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-logo-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(30, 111, 217, .24);
}

.auth-brand-title {
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
}

.auth-brand-subtitle {
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 600;
}

.auth-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-header-link,
.auth-header-link:link,
.auth-header-link:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-dark) !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
}

    .auth-header-link:hover {
        background: var(--brand-light);
        border-color: #cadffb;
    }

    .auth-header-link.danger {
        color: var(--danger) !important;
    }

.auth-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    box-shadow: var(--shadow-sm);
}

.auth-user-avatar {
    width: 30px;
    height: 30px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
}

    .auth-user-avatar * {
        max-width: 1ch;
        overflow: hidden;
    }

.auth-user-label {
    display: block;
    color: var(--ink-faint);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.auth-main {
    min-height: 560px;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding: 14px 4px;
    color: var(--ink-faint);
    font-size: 12px;
}

    .auth-footer img {
        width: 140px;
        height: 40px;
        object-fit: contain;
    }

/* Shared auth cards */
.auth-card-shell {
    display: flex;
    justify-content: center;
    padding: 28px 0;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.auth-card-header {
    padding: 30px 32px 24px;
    color: #fff;
    text-align: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.auth-card-icon {
    width: 62px;
    height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .28);
    font-size: 26px;
}

.auth-card-header h2 {
    margin: 0;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
}

.auth-card-header p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
}

.auth-card-body {
    padding: 28px 32px 32px;
}

.auth-form-group {
    margin-bottom: 16px;
}

    .auth-form-group label {
        display: block;
        margin-bottom: 6px;
        color: var(--ink-soft);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

.auth-input-wrap {
    position: relative;
}

    .auth-input-wrap .glyphicon {
        position: absolute;
        top: 50%;
        left: 14px;
        transform: translateY(-50%);
        color: var(--ink-faint);
        z-index: 2;
    }

.auth-input,
.auth-input.form-control {
    width: 100%;
    height: 46px;
    padding: 10px 14px 10px 42px;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    background: #fbfcfe;
    color: var(--ink);
    font-size: 14px;
    box-shadow: none;
}

    .auth-input:focus,
    .auth-input.form-control:focus {
        border-color: var(--brand);
        background: #fff;
        box-shadow: var(--ring);
        outline: none;
    }

.auth-btn,
.auth-btn.btn {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--success) 0%, #12803a 100%);
    color: #fff !important;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(22, 163, 74, .24);
    transition: all .18s ease;
}

    .auth-btn:hover,
    .auth-btn:focus {
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(22, 163, 74, .28);
    }

.auth-divider {
    height: 1px;
    margin: 22px 0;
    background: var(--line);
}

.auth-helper {
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.55;
}

.auth-security-note {
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--ink-soft);
    font-size: 13px;
}

.auth-back-link {
    color: var(--brand-dark) !important;
    font-weight: 800;
    text-decoration: none !important;
}

    .auth-back-link:hover {
        color: var(--brand) !important;
        text-decoration: underline !important;
    }

.auth-alert {
    border-radius: 12px;
    text-align: center;
}

.auth-strength .progress {
    height: 7px;
    margin: 0;
    background: #edf2f7;
    border-radius: 999px;
    box-shadow: none;
}

.auth-strength .progress-bar {
    border-radius: 999px;
    transition: width .2s ease, background-color .2s ease;
}

.auth-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 12px;
    margin: 14px 0 22px;
    padding: 0;
}

    .auth-rules li {
        list-style: none;
        color: var(--ink-faint);
        font-size: 12px;
    }

    .auth-rules .ok {
        color: var(--success);
        font-weight: 700;
    }

    .auth-rules .fail {
        color: var(--ink-faint);
    }

/* Profile page */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 22px;
}

.profile-card-icon-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.profile-banner {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid transparent;
}

@media (max-width: 760px) {
    .auth-header,
    .auth-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-card-body {
        padding: 24px;
    }

    .auth-rules,
    .profile-grid {
        grid-template-columns: 1fr;
    }
}
/* Auth pages: make Forgot/Change Password match Login.aspx */
.auth-card-shell {
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: radial-gradient(circle at top left, rgba(30, 111, 217, .16), transparent 32%), radial-gradient(circle at bottom right, rgba(0, 184, 169, .16), transparent 28%), linear-gradient(135deg, #f4f7fb 0%, #eef3f9 100%);
    border-radius: 14px;
}

.auth-card {
    max-width: 460px;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(16, 24, 40, .14);
}

.auth-card-header {
    padding: 28px 30px 22px;
}

.auth-card-icon {
    width: 58px;
    height: 58px;
    font-size: 24px;
}

.auth-btn-primary,
.auth-btn-primary.btn {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 10px 20px rgba(30, 111, 217, .24);
}

    .auth-btn-primary:hover,
    .auth-btn-primary:focus {
        box-shadow: 0 14px 28px rgba(30, 111, 217, .28);
    }

.auth-password-note {
    padding: 12px 14px;
    margin-bottom: 18px;
    color: var(--brand-dark);
    background: var(--brand-light);
    border: 1px solid #cadffb;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
}

.auth-form-group .text-danger {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

.auth-card .pw-rules,
.auth-card .auth-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin: 12px 0 20px;
    padding: 0;
    text-align: left;
}

    .auth-card .pw-rules li,
    .auth-card .auth-rules li {
        list-style: none;
        font-size: 12px;
    }

    .auth-card .pw-rules .ok,
    .auth-card .auth-rules .ok {
        color: var(--success);
        font-weight: 700;
    }

    .auth-card .pw-rules .fail,
    .auth-card .auth-rules .fail {
        color: var(--ink-faint);
    }

@media (max-width: 520px) {
    .auth-card .pw-rules,
    .auth-card .auth-rules {
        grid-template-columns: 1fr;
    }
}