/* SuperCRM theme - loaded after Bootstrap 3 + legacy Site.css.
   Modern look (LSS black/charcoal + one blue accent) and phone/tablet layout for the legacy pages.
   Pages keep their old markup; this file restyles it. */

:root {
    --ink: #1a2230;          /* text, logo black */
    --muted: #5f6670;
    --line: #e2e6eb;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --accent: #1b4f8a;       /* links, buttons, icons */
    --accent-hover: #143c6b;
    --accent-soft: #e6edf6;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --header-h: 64px;
    /* status colours, used by the chips on every page (Home dashboard, ticket lists) */
    --dash-good: #1e7b4f; --dash-good-bg: #e3f4ea;
    --dash-warn: #a65c00; --dash-warn-bg: #fff1dc;
    --dash-bad: #b42318;  --dash-bad-bg: #fde8e6;
}

/* ---------------------------------------------------------------- base */
html, body { background: var(--bg); }
body {
    padding-top: calc(var(--header-h) + 16px);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover, a:focus { color: var(--accent-hover); }
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
.body-content { max-width: 1680px; }
footer { color: var(--muted); font-size: 12px; }

/* Sticky footer: page is at least as tall as the window and the footer is pushed to the bottom edge. */
html { height: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; }
body > .body-content:not(.app-footer-wrap) { flex: 1 0 auto; width: 100%; }
body > .app-footer-wrap { flex: 0 0 auto; width: 100%; }
hr { border-color: var(--line); }

/* ---------------------------------------------------------------- header */
.app-header {
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    min-height: var(--header-h);
    margin: 0;
}
.app-header .navbar-brand { height: var(--header-h); padding: 10px 15px; display: flex; align-items: center; }
.app-header .navbar-brand img { height: 40px; width: auto; }
.app-header .navbar-nav > li > a {
    color: var(--ink);
    font-weight: 500;
    padding-top: 22px;
    padding-bottom: 20px;
    border-bottom: 2px solid transparent;
}
.app-header .navbar-nav > li > a:hover { color: var(--accent); background: transparent; }
.app-header .navbar-nav > li.active > a,
.app-header .navbar-nav > li.active > a:hover { color: var(--accent); background: transparent; border-bottom-color: var(--accent); }
.app-header .navbar-toggle { margin-top: 15px; border-color: var(--line); }
.app-header .navbar-toggle .icon-bar { background: var(--ink); }
.app-header .navbar-collapse { border-top-color: var(--line); }
.app-user { color: var(--muted); font-size: 12px; }
.app-user > li > a, .app-user > li > span { color: var(--muted); padding-top: 22px; padding-bottom: 20px; display: block; padding-left: 12px; padding-right: 12px; }
.app-user .user-name { color: var(--ink); font-weight: 600; }
.app-user .logoff { color: var(--accent); font-weight: 500; }
/* header-user-link: user name links to Settings > Account Info; keep right edge inside the viewport (bootstrap .navbar-right pulls it out by 15px) */
.app-user .user-link, .app-user .user-link:focus { color: var(--muted); text-decoration: none; }
.app-user .user-link:hover { color: var(--muted); text-decoration: underline; background: transparent; }
@media (min-width: 768px) {
    .app-header #logoutForm.navbar-right { margin-right: 0; padding-right: 20px; }
}
.app-header .container-fluid { max-width: 100%; overflow-x: clip; }
/* end header-user-link */

/* ---------------------------------------------------------------- panels (legacy fieldsets become cards) */
.body-content fieldset {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin-bottom: 16px;
    min-width: 0;
}
.body-content fieldset fieldset { box-shadow: none; }
.body-content legend {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

/* ---------------------------------------------------------------- form controls */
.body-content input[type=text], .body-content input[type=password], .body-content input[type=number],
.body-content input[type=email], .body-content input:not([type]), .body-content select, .body-content textarea {
    border: 1px solid #8a94a0;
    border-radius: 6px;
    padding: 5px 8px;
    background: #fff;
    color: var(--ink);
    max-width: 100%;
}
.body-content input[type=text], .body-content input[type=password], .body-content input[type=number],
.body-content input:not([type]), .body-content select { min-height: 32px; }
.body-content select.H26, .body-content input.H26 { height: 32px; }
.body-content input:focus, .body-content select:focus, .body-content textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(27, 79, 138, .25);
}
.body-content ::placeholder, .login-card ::placeholder { color: #6b737d; opacity: 1; }
.body-content a:focus-visible, .body-content button:focus-visible, .body-content [tabindex]:focus-visible, .app-header a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.body-content input[readonly] { background: #f7f8fa; color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); border-radius: 6px; font-weight: 500; }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-hover); border-color: var(--accent-hover); }
/* legacy big icon buttons (search, add, post...) */
a.btn > .fa { color: var(--accent); }
a.btn:hover > .fa { color: var(--accent-hover); }
a.btn { box-shadow: none; }
a.btn-primary > .fa, a.btn-danger > .fa, a.btn-primary:hover > .fa, a.btn-danger:hover > .fa { color: #fff; }
.btn-default { border-color: #8a94a0; }
a.btn.disabled { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------- tables */
.ContactTable, .js-grid, #TGrid table, #MyTickets table, #CustomerCare table {
    font-family: inherit;
    font-size: 12.5px;
    color: var(--ink);
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.ContactTable th, .js-grid th, #TGrid table th, #MyTickets table th, #CustomerCare table th {
    background: #f1f4f8;
    color: #4a525c;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0;
    padding: 8px 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.ContactTable th a, .js-grid th a { color: #4a525c; text-decoration: none; }
.ContactTable th a:hover, .js-grid th a:hover { color: var(--accent); }
.ContactTable td, .js-grid td, #TGrid table td, #MyTickets table td, #CustomerCare table td {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 6px 8px;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) {
    .ContactTable td.w200 { white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
}
.ContactTable tbody tr:last-child td, .js-grid tbody tr:last-child td { border-bottom: 0; }
.ContactTable tr:hover td { background-color: rgba(27, 79, 138, .06); }
.ContactTable tfoot td, .grid-pager { padding: 8px; font-size: 13px; }
.grid-pager a, .webgrid-footer a { display: inline-block; min-width: 26px; padding: 2px 6px; border-radius: 4px; text-align: center; }
.grid-pager span, .webgrid-footer span { display: inline-block; min-width: 26px; padding: 2px 6px; border-radius: 4px; background: var(--accent); color: #fff; text-align: center; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

/* ticket filter accordion */
.cd-accordion-menu label { box-shadow: inset 0 -1px var(--line); font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.cd-accordion-menu ul { padding: 4px 0 8px 4px; }
.cd-accordion-menu li li { padding: 2px 0; font-size: 13px; }
.filter-toggle { display: none; }

/* notes */
.TNoteRow, .SNoteRow, .NNoteRow, .NewRow {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    padding: 8px 10px !important;
    margin-bottom: 8px;
}
.SNoteField { max-width: 100% !important; }
.AM_Field input[type=checkbox] { width: auto; }
.note-search { margin: 6px 0 8px; display: flex; align-items: center; gap: 10px; }
.note-search input { max-width: 360px; }

/* customer boarding milestones (replace the old glossy images with flat pills) */
#boardingComplete, #boardingPending {
    background-image: none !important;
    height: auto !important;
    padding: 5px 4px !important;
    margin-bottom: 2px !important;
    border-radius: 999px;
    font-size: 11.5px !important;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#boardingComplete { background: #1e7a43; color: #fff; }
#boardingComplete a, #boardingComplete label { color: #fff; margin: 0; }
#boardingPending { background: #fff; color: var(--muted); border: 1px dashed #8a94a0; }
#boardingPending a, #boardingPending label { color: var(--muted); margin: 0; font-weight: 600; }
.boarding-btn { text-align: center; color: var(--muted); font-size: 11px; }
.module-check { margin-right: 6px; }
.module-check label { margin: 0 !important; font-weight: 600; font-size: 12px; }

/* login */
.login-card {
    max-width: 380px;
    margin: 40px auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 28px 28px 24px;
    text-align: center;
}
.login-card img { height: 52px; margin-bottom: 14px; }
.login-card h1 { font-size: 18px; color: var(--muted); font-weight: 500; margin: 0 0 18px; }
.login-card .form-control { height: 40px; border-radius: 6px; margin-bottom: 12px; }
.login-card .btn { width: 100%; height: 40px; margin-top: 18px; }

/* ticket edit: summary bar + actions */
.ticket-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 10px; }
.ticket-summary .ticket-id { font-size: 16px; }
.installed-version { display: inline-block; font-size: 13px; font-weight: 400; margin-left: 12px; color: inherit; }
.installed-version .iv-warn { color: #cc7a00; }
.installed-version .iv-muted { color: var(--muted, #6b7280); }
.ticket-summary label, .ticket-tasks label { font-weight: 400; margin: 0; }
.ticket-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; margin-bottom: 10px; }
.ticket-tasks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-left: 8px; color: var(--muted); }
.ticket-tasks-label { font-weight: 600; color: var(--ink); }
/* Small desktops (about 1024px): eight menu items plus the user block must stay on one row, or the header covers the page top. */
@media (min-width: 992px) and (max-width: 1199px) {
    .app-header .navbar-nav > li > a { padding-left: 10px; padding-right: 10px; }
    .app-user > li:first-child { display: none; }
}

/* list toolbars: search on the left, actions on the right */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.list-toolbar .txt54 { flex: 1 1 260px; min-width: 200px; width: auto; max-width: 560px; }
.list-toolbar-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }

/* ---------------------------------------------------------------- tablets & phones */
@media (max-width: 991px) {
    body { padding-top: calc(var(--header-h) + 8px); }
    .body-content { padding-left: 10px; padding-right: 10px; }

    /* The legacy pages lay panels side by side with inline % widths and floats: stack them. */
    .body-content fieldset,
    .body-content div[style*="float"]:not([class*="cke"]):not(.ui-dialog):not(.ui-dialog *):not(.boarding-btn):not(.module-check),
    .body-content span[style*="float"],
    .body-content div[style*="width"]:not([class*="cke"]):not([id^="cke"]):not(.ui-dialog):not(.ui-dialog *):not(#ui-datepicker-div):not(.boarding-btn):not(.module-check),
    .leftMenu, .rightContent, .resourceContent > div {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .body-content h2 span[style*="float"] { display: block; margin: 0 0 8px !important; }

    /* ...except small inline items that should stay in a row */
    .body-content div.boarding-btn[style] { float: left !important; width: 31% !important; margin-right: 2% !important; margin-bottom: 6px; }
    .body-content div.module-check[style] { float: left !important; width: auto !important; margin-right: 10px !important; }

    /* legacy fixed-% inputs */
    .txt5, .txt7, .txt10, .txt15, .txt18, .txt20, .txt25, .txt26, .txt47, .txt50, .txt54, .POCField { width: 100% !important; margin-bottom: 6px; }
    .w50, .w100, .w200, .w400, .w600 { width: auto; }
    textarea, .SalesNotes { max-width: 100% !important; width: 100% !important; }

    /* Tickets: filter panel folds behind a "Filters" button */
    .filter-toggle { display: block; width: 100%; margin-bottom: 12px; }
    .filter-col { display: none; }
    .filters-open .filter-col { display: block; }

    /* Customer page header (boarding buttons, action icons) wraps nicely */
    #boardingComplete, #boardingPending { margin-bottom: 4px; }

    .ui-dialog { max-width: 96vw !important; left: 2vw !important; }
    .ui-tabs-vertical > .ui-tabs-nav, .ui-tabs-vertical > .ui-tabs-panel { float: none !important; width: 100% !important; }

    /* phone tap targets */
    .ContactTable td a, .js-grid td a, a.deleteRow { display: inline-block; padding: 8px 4px; }
    .body-content input[type=checkbox], .body-content input[type=radio] { width: 20px; height: 20px; }

    /* ticket edit: Details/Subject first, then Basic Info selects, Consulting last */
    .ticket-cols { display: flex; flex-direction: column; }
    .ticket-cols > fieldset { order: 2; }
    .ticket-cols > fieldset:nth-child(2) { order: 1; }
    .ticket-cols > #divConsulting { order: 3; }
}

@media (max-width: 767px) {
    .app-header .navbar-brand img { height: 34px; }
    .app-header .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; border-bottom: 0; }
    .app-header .navbar-nav > li.active > a,
    .app-header .navbar-nav > li.active > a:hover { background: var(--accent-soft); border-radius: 6px; }
    .app-user > li > a, .app-user > li > span { padding-top: 8px; padding-bottom: 8px; }
    h1 { font-size: 22px; }
    a.btn > .fa-3x { font-size: 2.2em; }
    a.btn > .fa-5x { font-size: 3em; }
    /* stops iOS zoom on input focus */
    .body-content input[type=text], .body-content input[type=password], .body-content input[type=number], .body-content input[type=email], .body-content input:not([type]), .body-content select, .body-content textarea { font-size: 16px; }
    .ticket-tasks { margin-left: 0; width: 100%; }
}

@media (max-width: 767px) { .hide-xs { display: none; } }

/* ---------------------------------------------------------------- ticket summary report: range form, drill-down banner, per-member chart */
.report-range { margin: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.report-range label { margin: 0; font-weight: 600; }
.report-range input[type=date] { margin-left: 4px; }
.report-note { color: var(--ink); background: #fff7e0; border: 1px solid #f0d98a; border-radius: 6px; padding: 6px 10px; max-width: 700px; }
.report-drill { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.report-drill a { margin-left: 12px; white-space: nowrap; }

.viz-root { --series-1: #2a78d6; --series-2: #eb6834; }
.ticket-chart { margin-top: 24px; max-width: 900px; min-width: 0; }
.ticket-chart h3 { margin: 0 0 4px; font-size: 16px; }
.chart-legend { display: flex; gap: 16px; margin: 6px 0; color: var(--ink); }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.chart-scroll { overflow-x: auto; max-width: 100%; }
.ticket-chart .bar-assigned { fill: var(--series-1); }
.ticket-chart .bar-closed { fill: var(--series-2); }
.ticket-chart .chart-grid { stroke: #e3e6ea; stroke-width: 1; }
.ticket-chart .chart-axis { fill: var(--ink); font-size: 11px; }

/* print: only the report area (heading, range line, table) */
@media print {
    .app-header, .app-footer-wrap, .no-print, .filter-toggle { display: none !important; }
    html, body { background: #fff !important; height: auto !important; min-height: 0 !important; padding: 0 !important; display: block !important; }
    .body-content { max-width: none !important; padding: 0 !important; margin: 0 !important; }
    .ContactTable { box-shadow: none !important; border: 1px solid #999 !important; }
    .ContactTable th { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: #000 !important; text-decoration: none !important; }
    .ticket-chart .bar, .chart-swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .chart-scroll { overflow: visible; }
    .chart-scroll svg { min-width: 0 !important; }
}

/* ---------------------------------------------------------------- Manco customer panel (Contact edit page, levels 1 and 2) */
.manco-panel {
    clear: both;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin-bottom: 16px;
    min-width: 0;
}
.manco-heading {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
    margin-bottom: 12px;
}
.manco-panel p { margin-bottom: 8px; }
.manco-panel h4 { margin-top: 12px; font-size: 14px; }
.manco-message { color: var(--muted); }
.manco-warn { color: #c00; font-weight: 600; }
.manco-table-wrap { width: 100%; overflow-x: auto; margin-bottom: 12px; }
.manco-table-wrap .ContactTable { width: 100%; }
.manco-search { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.manco-search-term { width: 280px; max-width: 100%; }
@media (max-width: 991px) {
    .manco-search-term { width: 100%; }
}

/* ---------------------------------------------------------------- Call Home section (Contact edit page) */
.callhome-summary p { margin-bottom: 4px; }
.callhome-version { font-size: 15px; }
.callhome-stale td { color: var(--muted); }
.callhome-companies { margin: 0; padding-left: 14px; }
.callhome-note { font-size: 12px; }
.callhome-chart { margin-top: 12px; }
.callhome-chart .bar-people { fill: var(--series-1); }
@media (max-width: 767px) {
    .callhome-odd { display: none; }
}
@media print {
    .callhome-chart .bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------------------------------------------------------- Contact page: notes editor + Manco panel side by side, notes list full width */
.contact-notes-row { display: flex; gap: 16px; align-items: flex-start; clear: both; margin-bottom: 16px; }
.contact-notes-row > .contact-notes-editor { flex: 1 1 100%; min-width: 0; margin: 0; }
.contact-tabs { padding-top: 16px; margin-bottom: 12px; clear: both; } /* padding: a margin is swallowed by the clearance below the floated header */
.contact-tabs > li > a { padding: 8px 14px; }
.contact-tab-content > .tab-pane > .manco-panel { clear: both; width: 100%; }
@media (max-width: 480px) { .contact-tabs > li > a { padding: 8px 7px; font-size: 13px; } }
@media print {
    .contact-tabs { display: none !important; }
    .tab-content > .tab-pane { display: block !important; opacity: 1 !important; }
}
.contact-notes-list { width: 100%; clear: both; margin-bottom: 16px; }
@media (max-width: 991px) {
    .contact-notes-row { flex-direction: column; align-items: stretch; }
}

/* ---------------------------------------------------------------- Sales by Year: table left, bar chart right */
.sales-report { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.sales-chart { flex: 1 1 360px; max-width: 640px; margin: 0; }
.sales-chart figcaption { font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.sales-chart svg { width: 100%; height: auto; display: block; }
.sales-chart .bar-sales { fill: var(--series-1); }
.sales-chart .grid { stroke: var(--line); stroke-width: 1; }
.sales-chart .tick { fill: var(--muted); font-size: 11px; }
@media (max-width: 991px) { .sales-report .ContactTable { width: 100% !important; } }

/* ---------------------------------------------------------------- Reporting index: grouped cards */
.report-group { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 6px; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.report-card { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.report-card strong { color: var(--accent, #2a78d6); font-size: 14px; }
.report-card span { color: var(--muted); font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.report-card:hover, .report-card:focus { border-color: var(--accent, #2a78d6); text-decoration: none; color: var(--ink); }
.report-group-note { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
/* Licensing and Call Home: same card width as the other groups, 3 per row */
.report-group:has(.report-group-note) + .report-cards > .report-card:nth-child(3n+1) { grid-column-start: 1; }
.team-chart .team-name { font-size: 12px; }
.team-chart a .team-name { fill: var(--accent); }
.team-chart a:hover .team-name { text-decoration: underline; }
.team-chart .team-value { fill: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------- user administration (/Users) */
.user-table tr.user-inactive td, .user-table tr.user-inactive td a { color: #8a9099; }
@media (max-width: 991px) {
    .user-table thead { display: none; }
    .user-table, .user-table tbody, .user-table tr, .user-table td { display: block; width: 100%; }
    .user-table tr { border: 1px solid #dfe3e8; border-radius: 6px; margin-bottom: 10px; padding: 4px 8px; background: #fff; }
    .user-table td { border: 0; padding: 4px 0; text-align: left !important; }
    .user-table td::before { content: attr(data-label); display: inline-block; min-width: 110px; color: #6b7480; font-size: 12px; }
}

/* jQuery UI dialogs (email preview, confirmations): above the fixed top menu (Bootstrap navbar z-index 1030)
   and never taller than the screen, so the title bar and buttons stay visible; the content scrolls instead. */
.ui-widget-overlay.ui-front { z-index: 1040 !important; }
.ui-dialog.ui-front { z-index: 1050 !important; }
.ui-dialog .ui-dialog-content { max-height: calc(100vh - 140px); overflow-y: auto; }
/* Dialog close [x]: Bootstrap's button plugin replaces jQuery UI's, so the icon never renders - draw the "×" ourselves. */
.ui-dialog .ui-dialog-titlebar-close { font-size: 0; color: #444; text-indent: 0; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar-close .ui-icon, .ui-dialog .ui-dialog-titlebar-close .ui-button-icon-space { display: none; }
.ui-dialog .ui-dialog-titlebar-close::after { content: "\00d7"; font-size: 20px; line-height: 16px; font-weight: bold; display: block; text-align: center; }
.ui-dialog .ui-dialog-titlebar-close:hover::after { color: #c00; }

/* ---------------------------------------------------------------- Leads (list, edit, questionnaire) */
.lead-filters .list-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lead-filters .lead-dates label, .lead-filters .lead-check { font-weight: normal; margin: 0 6px 0 0; }
.lead-overdue { color: #c0262d; font-weight: 600; }
.lead-pager { margin: 14px 0; }
.lead-section { margin-bottom: 18px; }
.lead-section legend { font-size: 16px; font-weight: 600; border-bottom: 1px solid #dfe3e8; margin-bottom: 10px; }
.lead-phone-row { display: flex; gap: 6px; margin-bottom: 6px; }
.lead-phone-row input:first-child { flex: 0 0 38%; }
.lead-phone-row input:nth-child(2) { flex: 1 1 auto; }
.lead-table .label { margin-left: 6px; }
@media (max-width: 991px) {
    .lead-filters .list-toolbar > * { max-width: 100%; }
    .lead-filters .list-toolbar-actions { width: 100%; }
    .lead-phone-row { flex-wrap: wrap; }
    .lead-phone-row input:first-child, .lead-phone-row input:nth-child(2) { flex: 1 1 100%; }
    /* Leads dropdown inside the collapsed phone menu: show as an inline list, not a floating panel */
    .app-header .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin: 0; box-shadow: none; border: 0; background: transparent; }
    .app-header .navbar-nav .open .dropdown-menu > li > a { padding: 10px 10px 10px 28px; color: var(--ink); }
}

/* ---------------------------------------------------------------- Tickler (call-backs) */
.tickler-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.tickler-filters .tickler-goto { font-weight: normal; margin: 0; }
.tickler-legend .label { margin-right: 4px; }
.tickler-legend-overdue { background: #ffe066; color: #3a3000; }
.tickler-overdue-title { font-size: 16px; font-weight: 600; margin: 8px 0; }
.tickler-actions .btn { margin: 0 4px 4px 0; }
.tickler-calendar { margin: 12px 0 24px; }
.tickler-calendar .fc-event.tickler-overdue { background: #ffe066 !important; border-color: #d9b500 !important; color: #3a3000 !important; }
.tickler-calendar .fc-event.tickler-overdue .fc-title, .tickler-calendar .fc-event.tickler-overdue .fc-time { color: #3a3000 !important; }
.tickler-calendar .fc-list-item.tickler-overdue td { background: #fff3b0 !important; color: #3a3000 !important; }
.tickler-calendar .fc-list-item.tickler-overdue td a { color: #3a3000 !important; }
@media (max-width: 991px) {
    .tickler-table thead { display: none; }
    .tickler-table, .tickler-table tbody, .tickler-table tr, .tickler-table td { display: block; width: 100%; }
    .tickler-table tr { border: 1px solid #dfe3e8; border-radius: 6px; margin-bottom: 10px; padding: 4px 8px; background: #fff; }
    .tickler-table td { border: 0; padding: 4px 0; text-align: left !important; }
    .tickler-table td::before { content: attr(data-label); display: inline-block; min-width: 110px; color: #6b7480; font-size: 12px; }
    .tickler-table td.tickler-actions::before { content: none; }
    .tickler-calendar .fc-toolbar .fc-left, .tickler-calendar .fc-toolbar .fc-right, .tickler-calendar .fc-toolbar .fc-center { float: none; display: block; margin-bottom: 6px; text-align: left; }
}

/* Customer page: Modules group box (checkboxes in a wrapping row) */
.contact-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; margin-bottom: 12px; }
.contact-modules > legend { grid-column: 1 / -1; }
.contact-modules .module-check { float: none !important; display: flex; align-items: center; gap: 5px; margin: 0 !important; white-space: nowrap; }
.contact-modules .module-check input[type=checkbox] { margin: 0; flex: none; }
.contact-modules .module-check label { line-height: 1.35; }
.contact-modules .module-check > span { display: none; }
.contact-modules .module-check label { font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
/* Tickets come first in the markup (so they line up with Modules at the top); on phones show them after Management */
@media (max-width: 991px) { .contact-top { display: flex; flex-direction: column; } .contact-top > .contact-right { order: 9; } .poc-scroll { max-height: 300px; } }
/* Customer page: Quick Notes twice the old 4-row height */
#Contact_QuickNotes { height: 184px; }
/* Customer page desktop: Quick Notes sits under Company/Management beside Tickets; smaller gap between Modules and Tickets */
@media (min-width: 992px) {
    .contact-top + .padBottom10 { clear: left !important; margin-left: 2px !important; margin-bottom: 12px !important; }
    .contact-top + .padBottom10 textarea { height: 184px; }
    .contact-top > .contact-right { width: calc(68% - 12px) !important; }
}
/* Tabs (customer page, Leads, Licensing, Releases): inactive tabs get a tinted background so they read as tabs; active one is white with an accent top line */
.body-content .nav-tabs { border-bottom: 2px solid var(--accent); }
.body-content .nav-tabs > li { margin-bottom: 0; margin-right: 3px; }
.body-content .nav-tabs > li > a { background: var(--accent-soft); color: var(--accent); border: 1px solid #c9d6e6; border-bottom: none; border-radius: 6px 6px 0 0; margin-right: 0; }
.body-content .nav-tabs > li > a:hover, .body-content .nav-tabs > li > a:focus { background: #d3e0ef; color: var(--accent-hover); border-color: #b5c7dd; }
.body-content .nav-tabs > li.active > a, .body-content .nav-tabs > li.active > a:hover, .body-content .nav-tabs > li.active > a:focus {
    background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
/* Modules: "Don't follow up" goes last, in the right column, right under "Follow Ups" */
.contact-modules .module-check:has(label[title="NF"]) { order: 1; grid-column-start: 2; }

/* Home dashboard */
.dash { --dash-good: #1e7b4f; --dash-good-bg: #e3f4ea; --dash-warn: #a65c00; --dash-warn-bg: #fff1dc; --dash-bad: #b42318; --dash-bad-bg: #fde8e6; max-width: 1360px; margin: 0 auto; }
.dash-hello { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 16px; }
.dash-hello h1 { font-size: 22px; margin: 0; }
.dash-date { color: var(--muted); }
.dash-search { margin-bottom: 8px; max-width: 360px; }
@media (max-width: 575px) { .dash-search { max-width: 100%; } }
.dash-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.dash-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 12px; font-weight: 600; color: var(--ink); text-decoration: none; }
.dash-btn:hover, .dash-btn:focus { color: var(--ink); border-color: var(--accent); text-decoration: none; }
.dash-btn.primary, .dash-btn.primary:hover, .dash-btn.primary:focus { background: var(--accent); border-color: var(--accent); color: #fff; }
.dash-jump { display: flex; flex-direction: column; gap: 4px; }
.dash-jump form { display: flex; gap: 4px; margin: 0; }
.dash-jump input { width: 110px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-weight: 600; color: var(--ink); background: #fff; }
.dash-jump input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(0,0,0,.08); }
.dash-jump .dash-btn { padding: 7px 10px; line-height: inherit; }
.dash-jump-msg { color: #b42318; font-size: 12px; }
.dash-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.dash-chip[hidden] { display: none; }
.dash-chip.info { background: var(--accent-soft); color: var(--accent); }
.dash-chip.good { background: var(--dash-good-bg); color: var(--dash-good); }
.dash-chip.warn { background: var(--dash-warn-bg); color: var(--dash-warn); }
.dash-chip.bad { background: var(--dash-bad-bg); color: var(--dash-bad); }
.dash-chip.teal { background: #dff3f1; color: #0f6b63; }
.dash-chip.grey { background: #eef0f3; color: #4a5260; }
.dash-chip.purple { background: #efe9fb; color: #5b3aa8; }
.dash-chip.muted { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); text-decoration: line-through; }
/* Ticket type = outlined pill, so it never reads as a status */
.dash-chip.type { background: transparent; box-shadow: inset 0 0 0 1px currentColor; font-weight: 600; }
.dash-chip.type.support { color: var(--accent); }
.dash-chip.type.consulting { color: var(--dash-good); }
.dash-chip.type.boarding { color: #0f6b63; }
.dash-chip.type.test { color: var(--dash-warn); }
.dash-chip.type.other { color: var(--muted); }
.dash-pri { display: inline-block; width: 76px; text-align: center; }
/* Consulting stages are longer ("Delivered – not paid"): grow instead of overflowing into Amount */
.dash-pane[data-pane="consulting"] .dash-pri { width: auto; min-width: 76px; }
.dash-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 12px 14px; display: block; color: var(--ink); border-top: 3px solid var(--accent); text-decoration: none; }
.dash-tile:hover, .dash-tile:focus { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.dash-tile .n { font-size: 28px; font-weight: 700; line-height: 1.1; }
.dash-tile .l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dash-tile .d { font-size: 12px; margin-top: 4px; color: var(--muted); }
.dash-tile.warn { border-top-color: #e08a00; }
.dash-tile.bad { border-top-color: var(--dash-bad); }
.dash-tile.good { border-top-color: var(--dash-good); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px; min-width: 0; }
.dash-card h2 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-more { margin-left: auto; font-size: 12px; font-weight: 600; }
.dash-more[hidden] { display: none; }
.dash-muted { color: var(--muted); }
.dash-sub { font-size: 12px; margin: -4px 0 8px; }
.dash-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--accent); margin-bottom: 6px; flex-wrap: wrap; }
.dash-tabs a { padding: 6px 12px; border-radius: 6px 6px 0 0; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; text-decoration: none; }
.dash-tabs a.on { background: var(--accent); color: #fff; }
.dash-tabs b { font-weight: 700; opacity: .85; margin-left: 4px; }
.dash-list { width: 100%; border-collapse: collapse; }
.dash-list td, .dash-list th { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.dash-list th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.dash-list tbody tr:hover td { background: #f8fafc; }
.dash-age { font-variant-numeric: tabular-nums; font-weight: 600; }
.dash-subj { color: var(--muted); }
.dash-mini { list-style: none; margin: 0; padding: 0; }
.dash-mini li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.dash-mini .grow { flex: 1; min-width: 0; }
.dash-mini .grow div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-mini small { color: var(--muted); }
@media (max-width: 991px) {
    .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: minmax(0, 1fr); } /* minmax: a wide table scrolls in its card instead of widening the page */
    .dash-actions { margin-left: 0; }
    .dash-jump { flex: 1 1 100%; }
    .dash-jump input { flex: 1; width: auto; min-width: 0; }
    .dash-hello h1 { font-size: 19px; }
}
@media (max-width: 767px) {
    .dash-hide-sm { display: none; }
    .dash-stack thead { display: none; }
    .dash-stack, .dash-stack tbody, .dash-stack tr, .dash-stack td { display: block; width: 100%; }
    .dash-stack tr { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; padding: 4px 8px; background: #fff; }
    .dash-stack td { border: 0; padding: 3px 0; }
    .dash-stack td::before { content: attr(data-label); display: inline-block; min-width: 80px; color: var(--muted); font-size: 12px; }
}

.vr-expired, .vr-expired td { background-color: rgba(255, 214, 0, 0.22); }

/* Lead edit: old-app layout */
.lead-answer { display: flex; align-items: center; gap: 8px; }
.lead-answer .form-control { flex: 1 1 auto; min-width: 0; }
.lead-answer-quick { flex: 0 0 auto; display: flex; gap: 4px; }
.lead-answer-quick .btn { min-width: 50px; padding: 4px 13px; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid #b8c2cc; }
.lead-answer-quick .btn:hover, .lead-answer-quick .btn:focus { background: var(--accent-soft, #e8f1fb); border-color: var(--accent, #2a78d6); color: var(--accent, #2a78d6); }
.lead-old { max-width: 1100px; }
.lead-old-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lead-old-buttons .btn-group { display: inline-flex; }
.lead-old-tabs { margin-bottom: 14px; }
.lead-old-cols { display: flex; gap: 28px; align-items: flex-start; }
.lead-old-left { flex: 0 0 auto; width: 480px; }
.lead-old-right { flex: 1 1 320px; min-width: 0; max-width: 460px; }
.lead-old-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.lead-old-row > label { flex: 0 0 110px; text-align: right; font-style: italic; font-weight: normal; font-size: 13px; color: var(--muted); margin: 0; }
.lead-old-row > .form-control, .lead-old-row > .phone-box, .lead-old-pair { flex: 0 1 320px; min-width: 0; }
.lead-old-static { flex: 1 1 auto; font-weight: 600; min-height: 20px; }
.lead-old-pair { display: flex; gap: 6px; }
.lead-old-pair .lead-old-state { flex: 0 0 90px; }
.lead-old-pair .lead-old-zip { flex: 1 1 auto; min-width: 0; }
.lead-old-phones { margin-bottom: 8px; }
.lead-old-phones-head, .lead-old-phones .lead-phone-row { display: grid; grid-template-columns: 1fr 1fr 24px; gap: 6px; align-items: center; }
.lead-old-phones .lead-phone-remove { padding: 2px; color: var(--muted); }
.lead-old-phones .lead-phone-remove:hover { color: #c0392b; }
.lead-old-phones-head { font-style: italic; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.lead-old-phones .lead-phone-row input:first-child, .lead-old-phones .lead-phone-row input:nth-child(2) { flex: none; }
.lead-old-checks { margin: 8px 0; }
.lead-old-right .lead-old-row > label { flex-basis: 120px; }
.lead-old-help { margin: 0 0 6px 130px; }
.lead-old-notes { margin-top: 10px; }
.lead-old-wide > .form-control { flex: 1 1 auto; max-width: 860px; }
.lead-old-notes .lead-old-wide:first-child > .form-control { max-width: 530px; }
@media (max-width: 991px) {
    .lead-old-cols { flex-direction: column; gap: 10px; }
    .lead-old-left, .lead-old-right { width: 100%; max-width: none; flex: none; }
    .lead-old-row { flex-direction: column; align-items: stretch; gap: 2px; }
    .lead-old-row > label, .lead-old-right .lead-old-row > label { flex: none; text-align: left; }
    .lead-old-static { flex: none; }
    .lead-old-row > .form-control, .lead-old-row > .phone-box, .lead-old-pair { flex: none; width: 100%; }
    .lead-old-help { margin-left: 0; }
}

/* Click to call */
.call-link { color: #1a7f37; text-decoration: none; }
.call-link:hover { color: #11602a; }
.call-link.is-disabled { color: #aaa; pointer-events: none; cursor: default; }
.call-link.email-link:not(.is-disabled), .call-link.email-link:not(.is-disabled):hover { color: var(--accent); }
.poc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.poc-row select { flex: 1 1 0; min-width: 0; width: auto !important; }
.poc-call { flex: 0 0 auto; font-size: 18px; padding: 0 4px; }
.poc-ext { flex: 0 0 100%; font-size: 12px; color: #666; white-space: nowrap; }
.poc-ext:empty { display: none; }
.phone-box { position: relative; display: inline-block; vertical-align: middle; }
.phone-box > input { width: 100% !important; padding-right: 22px; margin-bottom: 0; }
.phone-box-call, .email-box-call { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 14px; line-height: 1; padding: 0; }
.form-group > .phone-box { display: block; width: 100%; }
.lead-phone-row > .phone-box { flex: 1 1 auto; }
.lead-old-phones .lead-phone-row > .phone-box { display: block; width: 100%; }
@media (max-width: 991px) {
    .phone-box { display: block; width: 100%; margin-bottom: 6px; }
    .lead-phone-row > .phone-box { flex: 1 1 100%; margin-bottom: 0; }
}

/* Kickoff page title: plain app heading instead of the old green banner */
body .form-style-6 h1 {
    background: none; color: var(--ink); text-align: left; font-size: 22px; font-weight: 600;
    padding: 0 0 8px; margin: 0 0 16px; border-bottom: 2px solid var(--accent);
}

/* Customer page POC rows: line 1 = role, names, email, phone, ext; line 2 = description (role..email) + delete (desktop).
   Both lines share one column grid so the description ends exactly under the email box. */
@media (min-width: 992px) {
    .poc-line1, .poc-line2 { display: grid; grid-template-columns: 13px .9fr 1fr 1fr 2.2fr 1.4fr .5fr; gap: 4px; align-items: center; }
    .poc-line1 > input[type="text"], .poc-line1 > .phone-box, .poc-line2 > .poc-desc { width: auto !important; min-width: 0; margin: 0; }
    .poc-line2 { margin-top: 4px; }
    .poc-line2 > .poc-desc { grid-column: 2 / 6; }
    .poc-line2 > .deleteRow { grid-column: 6 / 8; justify-self: start; padding-left: 0; }
}

/* Customer page: help line under "Points Of Contact" */
.poc-help { color: var(--muted); font-size: 12px; margin: -4px 0 8px; }
.poc-help-dot { display: inline-block; width: 11px; height: 11px; border: 1px solid var(--muted); border-radius: 50%; vertical-align: -1px; }

/* Home: My to-do card */
.todo-add { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.todo-add input[type=text] { flex: 1 1 140px; min-width: 0; }
.todo-add input[type=date] { flex: 0 1 140px; min-width: 0; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.todo-list .todo-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo-list li.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-list form { margin: 0; }
.todo-x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; }
.todo-x:hover { color: var(--dash-bad); }
.todo-error { color: var(--dash-bad); margin: 0 0 6px; }
.todo-linkbtn { flex-basis: 100%; text-align: left; background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.todo-linkbtn:hover, .todo-linkbtn:focus { color: var(--accent); text-decoration: underline; }
.todo-linkrow { display: none; flex: 1 1 100%; gap: 6px; flex-wrap: wrap; }
.todo-linkrow.open { display: flex; }
.todo-linkrow input { flex: 1 1 120px; min-width: 0; }
.todo-list li.editing { flex-wrap: wrap; }
/* text on the first line, the ticket / customer link under it */
.todo-list .todo-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.todo-list .todo-text { cursor: pointer; }
.todo-list .todo-link { align-self: flex-start; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.todo-list .todo-link:hover { color: var(--accent); }
.todo-edit-btn { background: none; border: 0; color: var(--muted); padding: 0 4px; cursor: pointer; }
.todo-edit-btn:hover, .todo-edit-btn:focus { color: var(--accent); }
.todo-list form.todo-edit { display: none; flex: 1 1 100%; flex-wrap: wrap; gap: 6px; align-items: center; }
.todo-list li.editing > :not(.todo-edit) { display: none; }
.todo-list li.editing > form.todo-edit { display: flex; }
.todo-edit input[type=text] { flex: 1 1 140px; min-width: 0; }
.todo-edit input[name=description] { flex-basis: 100%; }
.todo-edit input[type=date] { flex: 0 1 140px; min-width: 0; }
.todo-edit-btns { display: flex; gap: 6px; }
@media (max-width: 480px) {
  .todo-add input[type=text] { flex-basis: 100%; }
  .todo-add input[type=date] { flex: 1 1 0; }
  .todo-edit input[type=date], .todo-edit input[type=text] { flex-basis: 100%; }
  .todo-edit-btns { flex-basis: 100%; }
}

/* Saved replies */
.reply-list { list-style: none; margin: 0 0 10px; padding: 0; max-width: 720px; }
.reply-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.reply-list .reply-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.reply-list form { margin: 0; }
.reply-form { max-width: 720px; }
.reply-pick { width: 100%; max-width: 533px; margin-bottom: 4px; }

/* Edit conflicts (ticket / customer): early-warning banner + review panel after a refused save */
.edit-conflict-banner { position: sticky; top: 0; z-index: 1030; margin-bottom: 10px; }
.edit-conflict { clear: both; }
.edit-conflict-title { margin-bottom: 6px; }
.edit-conflict-sub { margin: 6px 0 4px; }
.edit-conflict-scroll { overflow-x: auto; max-width: 100%; }
.edit-conflict-table { background: transparent; margin-bottom: 6px; }
.edit-conflict-table td, .edit-conflict-table th { overflow-wrap: anywhere; word-break: break-word; max-width: 40vw; }
.edit-conflict-actions .btn { margin: 4px 6px 0 0; }
@media (max-width: 991px) { .edit-conflict-actions .btn { display: block; width: 100%; margin: 6px 0 0; } }

/* Customer page: tickets filter bar */
.cust-ticket-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:6px 0 10px; }
.contact-tickets #showTickets { overflow-x: auto; }
@media (max-width: 991px) { .contact-right { width: 100% !important; float: none !important; } }
.contact-tickets .cust-ticket-bar #ticketSearch { width:260px; max-width:100%; }
.contact-tickets .cust-ticket-bar #ticketStatus { width:auto; min-width:150px; }
.cust-ticket-bar .btn { margin-left:auto; }
@media (max-width: 575px) { .contact-tickets .cust-ticket-bar #ticketSearch, .contact-tickets .cust-ticket-bar #ticketStatus { width:100%; flex:1 1 100%; } .cust-ticket-bar .btn { margin-left:0; } }

/* Customers list: narrower search box, labelled buttons */
#ContactList .list-toolbar .txt54, #TicketFilterForm .list-toolbar .txt54 { flex: 1 1 220px; max-width: none; }
#ContactList .list-toolbar-actions, #TicketFilterForm .list-toolbar-actions { gap: 6px; flex-wrap: wrap; }
#ContactList .list-toolbar-actions .btn, #TicketFilterForm .list-toolbar-actions .btn { white-space: nowrap; }
@media (max-width: 575px) { #ContactList .list-toolbar-actions, #TicketFilterForm .list-toolbar-actions { margin-left: 0; width: 100%; } }

/* Sortable grids: column names in the link colour (no underline, owner 2026-11-02); underline only on hover */
.js-grid th:not([data-nosort]) a { color: var(--accent); text-decoration: none; }
.js-grid th:not([data-nosort]) a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Consulting month close: sheet page and Home reminder row */
.consulting-submit { margin: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.todo-consulting { margin-bottom: 0; }
.todo-consulting li { border-bottom: 1px solid var(--line); }

/* ---- Help (user guide) ---- */
.help-q { margin-left: 8px; font-size: 0.7em; color: var(--muted); vertical-align: middle; text-decoration: none; }
.help-q:hover, .help-q:focus { color: var(--accent); text-decoration: none; }
.help-intro { color: var(--muted); max-width: 75ch; }
.help-search { max-width: 420px; margin: 12px 0 16px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.help-card { border: 1px solid #ddd; border-radius: 6px; padding: 14px 16px; background: #fff; }
.help-card h3 { margin: 0 0 6px; font-size: 18px; }
.help-card p { color: var(--muted); }
.help-card ul { padding-left: 18px; margin: 0; font-size: 13px; }
.help-nav-all { display: block; margin-bottom: 8px; font-weight: 600; }
.help-nav-list { list-style: none; padding: 0; margin: 0 0 16px; }
.help-nav-list li a { display: block; padding: 5px 10px; border-left: 3px solid transparent; color: var(--ink); }
.help-nav-list li.active a { border-left-color: var(--accent); color: var(--accent); font-weight: 600; background: rgba(27,79,138,.07); }
.help-nav-select { display: none; margin-bottom: 14px; }
.help-toc { background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 6px; padding: 10px 14px; margin: 12px 0 18px; max-width: 75ch; }
.help-toc ul { margin: 4px 0 0; padding-left: 18px; }
.help-content { max-width: 75ch; line-height: 1.55; }
.help-content h2 { margin-top: 28px; padding-top: 6px; border-top: 1px solid #eee; font-size: 22px; }
.help-content h3 { margin-top: 20px; font-size: 18px; }
.help-content table { border-collapse: collapse; margin: 12px 0; }
.help-content th, .help-content td { border: 1px solid #ccc; padding: 5px 9px; }
.help-content th { background: #f3f3f3; }
.help-content img { max-width: 100%; height: auto; border: 1px solid #ccc; }
.help-content code { word-break: break-word; }
@media (max-width: 991px) {
    .help-nav-list, .help-nav-all { display: none; }
    .help-nav-select { display: block; }
    .help-content table { display: block; overflow-x: auto; }
}
@media print { .help-nav, .help-q, .app-header { display: none !important; } .help-content, .help-toc { max-width: none; } }

/* Tickets filter bar */
.tk-title { margin-top: 0; }
.tk-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.tk-bar .tk-search { flex: 1 1 260px; min-width: 200px; width: auto; max-width: 480px; }
.tk-plat { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; color: var(--ink); }
.tk-plat select { width: auto; min-width: 70px; }
.tk-reset { color: var(--accent); font-size: 13px; white-space: nowrap; }
.tk-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.tk-more { display: inline-block; }
.fdd { position: relative; }
.fdd-btn { height: 30px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-size: 13px; white-space: nowrap; max-width: 100%; }
.fdd-btn:hover { border-color: var(--accent); }
.fdd-btn:focus-visible, .fdd-row:focus-within, .tk-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fdd-sum { font-weight: 600; }
.fdd-panel { position: absolute; top: 100%; left: 0; z-index: 1000; margin-top: 2px; min-width: 200px; max-width: calc(100vw - 32px); max-height: 320px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 16px rgba(16, 24, 40, .15); padding: 4px 0; }
.fdd-row { display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 12px; font-weight: 400; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.fdd-row:hover { background: var(--accent-soft); }
.fdd-row input { margin: 0; }
.fdd-all { font-weight: 600; border-bottom: 1px solid var(--line); }
.fdd-sep { margin: 4px 0; border-top: 1px solid var(--line); }
.fdd-inactive span { color: var(--muted); font-style: italic; }
.fdd-custom { display: flex; flex-direction: column; gap: 6px; padding: 6px 12px 8px; }
.fdd-custom input { width: 130px; }
.tk-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 10px; overflow-x: auto; white-space: nowrap; }
.tk-tab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 8px 14px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.tk-tab:hover { color: var(--ink); text-decoration: none; }
.tk-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
#tkPreview { position: absolute; z-index: 1100; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 6px 16px rgba(16, 24, 40, .2); padding: 8px 10px; font-size: 13px; color: var(--ink); pointer-events: none; }
#tkPreview .tk-prev-text { margin-top: 4px; white-space: pre-line; color: var(--muted); }
@media (max-width: 767px) {
    .tk-bar .tk-search { flex: 1 1 100%; max-width: none; }
    .tk-bar > .fdd, .tk-bar > .tk-plat { flex: 1 1 calc(50% - 6px); min-width: 0; }
    .fdd { position: static; }
    .fdd-btn { width: 100%; text-align: left; overflow: hidden; text-overflow: ellipsis; }
    .tk-plat { justify-content: space-between; }
    .tk-plat select { flex: 1 1 auto; }
    .fdd-panel { left: 0; right: 0; min-width: 0; max-width: none; }
    .tk-actions { margin-left: 0; }
}
@media print { .tk-bar, .tk-tabs { display: none !important; } }

/* Help panel: user guide docked to the right edge (js/help-panel.js; iframe of /Help?embed=1) */
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; z-index: 1040; display: flex; flex-direction: column; background: #fff; border-left: 1px solid #d5d9de; box-shadow: -4px 0 16px rgba(0,0,0,.15); }
.help-panel[hidden] { display: none; }
.help-splitter { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 1; touch-action: none; }
.help-splitter:hover, .help-splitter:focus, .help-dragging .help-splitter { background: var(--accent-soft); outline: none; box-shadow: inset 2px 0 0 var(--accent); }
.help-panel-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #e1e4e8; background: #f6f8fa; flex: 0 0 auto; }
.help-panel-title { flex: 1 1 auto; font-weight: 600; color: var(--ink); }
.help-panel-newtab { color: var(--muted); }
.help-panel-newtab:hover, .help-panel-newtab:focus { color: var(--accent); }
.help-panel-close { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); padding: 0 4px; cursor: pointer; }
.help-panel-close:hover, .help-panel-close:focus { color: var(--accent); }
.help-panel-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
.help-dragging .help-panel-frame { pointer-events: none; }
body.help-resizing { user-select: none; -webkit-user-select: none; cursor: ew-resize; }
@media (max-width: 767px) {
    .help-panel { width: 100% !important; border-left: 0; box-shadow: none; }
    .help-splitter { display: none; }
}
/* inside the panel (layout _HelpEmbed): always the one-column phone style */
.help-embed { display: block; min-height: 0; padding-top: 0; padding-bottom: 16px; }
.help-embed .body-content { padding-top: 8px; }
.help-embed .help-layout > div { width: 100%; float: none; }
.help-embed .help-nav-list, .help-embed .help-nav-all { display: none; }
.help-embed .help-nav-select { display: block; }
.help-embed .help-search { max-width: none; margin: 4px 0 12px; }
.help-embed .help-grid { grid-template-columns: 1fr; }
.help-embed .help-content table { display: block; overflow-x: auto; }
@media print { .help-panel { display: none !important; } }

/* Click-to-copy text (ticket # on the ticket page): same look, pointer cursor, small "Copied" note */
.copy-text { cursor: pointer; }
.copy-text:focus { outline: none; }
.copy-text:focus-visible { outline: 2px solid var(--accent, #1b4f8a); outline-offset: 2px; border-radius: 3px; }
.copy-note { margin-left: 6px; font-size: 12px; font-weight: normal; color: #2e7d32; }

/* Customer page heading: platform + company name, support expiry on the line below */
.contact-head { float: left; max-width: 520px; }
.contact-head-name { font-weight: 600; }
.contact-head-exp { display: block; margin-top: 4px; font-size: 15px; font-weight: normal; }
@media (max-width: 991px) { .contact-head { float: none; display: block; max-width: none; } }

/* ---------------------------------------------------------------- hosting servers (/HostingServers) */
#hsAdd { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 991px) {
    #hsAdd .form-control { width: 100%; }
    .user-table td .form-control { width: 100% !important; }
}
