/* ===========================================================================
   custom.css — project-specific overrides on top of AdminLTE 3.
   Keep app-wide tweaks here; do not edit vendor files under /assets/plugins.
   Chisel brand tokens come from branding/colours.css.
   =========================================================================== */

:root {
    --chisel-purple: #501A91;
    --chisel-lilac: #B18AF5;
    --chisel-brand-ink: #13101C;
    --chisel-white: #FFFFFF;
    --chisel-text: #211D29;
    --chisel-muted: #746F7B;
    --chisel-paper: #FAF9F6;
    --chisel-line: #E5E1E8;
    --chisel-lavender: #EDE5F7;
    --chisel-button-hover: #6827AE;
    --chisel-focus: #AF87E2;
}

@font-face {
    font-family: 'Spectral';
    src: url('../fonts/Spectral-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* DM Sans, bundled locally under the SIL Open Font License. Regular and medium only:
   the app has no bold. Latin Extended covers names such as Welsh and Polish ones. */
@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-latin-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-latin-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-latin-ext-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-latin-ext-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------------------
   Brand base. DM Sans is the app's text font, as on the sales site. Manrope was
   not supplied and is not used.
   --------------------------------------------------------------------------- */
body,
.content-wrapper {
    background-color: var(--chisel-paper);
}

body,
.tooltip,
.popover {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    color: var(--chisel-text);
}

a {
    color: var(--chisel-purple);
}

a:hover {
    color: var(--chisel-button-hover);
}

/* Link-style buttons follow the links, not AdminLTE blue. */
.btn-link {
    color: var(--chisel-purple);
}

.btn-link:hover,
.btn-link:focus {
    color: var(--chisel-button-hover);
}

.text-muted {
    color: var(--chisel-muted) !important;
}

.card {
    border: 1px solid var(--chisel-line);
    border-radius: 14px;
    box-shadow: none;
}

.card-header {
    background: transparent;
    border-bottom-color: var(--chisel-line);
}

.btn {
    border-radius: 7px;
}

.btn-default {
    background-color: transparent;
    border-color: var(--chisel-purple);
    color: var(--chisel-purple);
}

.btn-default:hover,
.btn-default:focus {
    background-color: var(--chisel-lavender);
    border-color: var(--chisel-purple);
    color: var(--chisel-purple);
}

.form-control {
    border-color: var(--chisel-line);
    border-radius: 7px;
}

/* Tinted status pills, as in the site's job book. */
.badge {
    padding: 0.35em 0.6em;
    border-radius: 6px;
    font-size: 0.8125rem;
}

.badge-success {
    background-color: #E6F2EA;
    color: #2F6B45;
}

.badge-secondary {
    background-color: var(--chisel-lavender);
    color: var(--chisel-text);
}

.badge-primary {
    background-color: var(--chisel-lavender);
    color: var(--chisel-purple);
}

/* Outline buttons in brand purple, not AdminLTE blue (the Visits calendar). */
.btn-outline-primary {
    color: var(--chisel-purple);
    border-color: var(--chisel-purple);
}

.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active {
    color: var(--chisel-white);
    background-color: var(--chisel-purple);
    border-color: var(--chisel-purple);
}

.btn-outline-primary:focus {
    box-shadow: none;
}

/* Quiet table headings. */
table.dataTable thead tr:not(.dt-column-filters) th {
    color: var(--chisel-muted);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table-bordered,
.table-bordered td,
.table-bordered th {
    border-color: var(--chisel-line);
}

.btn-primary {
    background-color: var(--chisel-purple);
    border-color: var(--chisel-purple);
    color: var(--chisel-white);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--chisel-button-hover);
    border-color: var(--chisel-button-hover);
    color: var(--chisel-white);
}

/* AdminLTE underlines links in a callout and turns them pale on hover
   (.callout a, .callout a:hover), which outranks the button rules above.
   Buttons in a callout look and hover like every other button. */
.callout a.btn {
    text-decoration: none;
}

.callout a.btn-default,
.callout a.btn-default:hover,
.callout a.btn-default:focus {
    color: var(--chisel-purple);
}

.callout a.btn-primary,
.callout a.btn-primary:hover,
.callout a.btn-primary:focus {
    color: var(--chisel-white);
}

.btn-primary.disabled,
.btn-primary:disabled {
    background-color: var(--chisel-purple);
    border-color: var(--chisel-purple);
}

.card-primary.card-outline {
    border-top-color: var(--chisel-purple);
}

.form-control:focus {
    border-color: var(--chisel-purple);
    box-shadow: none;
}

.page-item.active .page-link {
    background-color: var(--chisel-purple);
    border-color: var(--chisel-purple);
}

.page-link {
    color: var(--chisel-purple);
}

/* Focus. The homepage's #AF87E2 reaches only 2.8:1 on white, below the 3:1 needed
   for a focus indicator, so focus uses brand purple. Every surface is light. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--chisel-purple);
    outline-offset: 2px;
    box-shadow: none;
}

/* ---------------------------------------------------------------------------
   Type, after getchisel.co.uk. No bold: regular text, medium for emphasis, and
   Spectral SemiBold (the one supplied cut) for page headlines only. AdminLTE's
   heavier defaults are overridden here rather than in the vendor file.
   --------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
b, strong, th, dt, .card-title, .modal-title, .badge, .btn, .close,
.nav-link, .page-link, .dropdown-item, .toast-title, .alert,
label:not(.form-check-label):not(.custom-file-label),
table.dataTable thead th {
    font-weight: 500;
}

.content-header h1 {
    font-family: 'Spectral', Georgia, serif;
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: -0.02em;
    color: var(--chisel-text);
}

.chisel-eyebrow {
    margin-bottom: 0.75rem;
    color: var(--chisel-purple);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.chisel-accent {
    color: var(--chisel-purple);
}

/* Build status notice: test deployments must be labelled incomplete. */
.chisel-build-note {
    color: var(--chisel-muted);
    font-size: 0.875rem;
}

/* ---------------------------------------------------------------------------
   AdminLTE shell
   --------------------------------------------------------------------------- */
.main-header.navbar {
    background-color: var(--chisel-paper);
    border-bottom: 1px solid var(--chisel-line);
}

.main-footer {
    background-color: var(--chisel-paper);
    border-top-color: var(--chisel-line);
}

/* The sidebar shares the page background, divided by a hairline. */
.main-sidebar.sidebar-light-primary {
    background-color: var(--chisel-paper);
    border-right: 1px solid var(--chisel-line);
    box-shadow: none;
}

.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link {
    color: var(--chisel-text);
    border-radius: 7px;
}

.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link:hover {
    background-color: var(--chisel-lavender);
    color: var(--chisel-text);
}

.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active:hover {
    background-color: var(--chisel-lavender);
    color: var(--chisel-purple);
    box-shadow: none;
}

/* Menu group headings: small purple labels, like the page eyebrows. */
.sidebar-light-primary .nav-sidebar > .nav-header.chisel-nav-header {
    padding: 1rem 1rem 0.35rem;
    color: var(--chisel-purple);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    background: transparent;
}

.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar > .nav-header.chisel-nav-header {
    visibility: hidden;
    padding-top: 0.5rem;
    padding-bottom: 0;
    height: 0.5rem;
    overflow: hidden;
}

.main-sidebar .brand-link {
    display: block;
    height: 3.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--chisel-line) !important;
}

/* Horizontal signature when open; the mark alone when the sidebar is collapsed. */
.brand-link .chisel-brand-full {
    display: block;
    height: 2.5rem;
    width: auto;
}

.brand-link .chisel-brand-mark {
    display: none;
    height: 2.5rem;
    width: auto;
}

@media (min-width: 992px) {
    .sidebar-collapse:not(.sidebar-no-expand) .main-sidebar:not(:hover) .chisel-brand-full {
        display: none;
    }
    .sidebar-collapse:not(.sidebar-no-expand) .main-sidebar:not(:hover) .chisel-brand-mark {
        display: block;
    }
}

/* Compact Fixer header */
.chisel-fixer-mark {
    height: 2rem;
    width: auto;
}

/* ---------------------------------------------------------------------------
   Sign-in page — split layout (brand panel left, form right).
   Inspired by the Adminator sign-in (form on the right-hand side) but built
   from AdminLTE 3 components. Fully responsive: the left panel collapses on
   small screens.
   --------------------------------------------------------------------------- */
.signin-wrapper {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
}

.signin-brand {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--chisel-text);
    background: var(--chisel-paper);
}

.signin-brand .signin-brand-inner {
    max-width: 420px;
}

.signin-brand .signin-logo {
    display: block;
    width: 200px;
    height: auto;
    margin-bottom: 2.5rem;
}

/* Marketing-style headline: Spectral SemiBold, per the brand guide. */
.signin-brand h1 {
    font-family: 'Spectral', Georgia, serif;
    font-weight: 600;
    font-size: 3rem;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

/* The form sits directly on the page background, with a hairline around it. */
.signin-card .card {
    background: transparent;
}

.signin-card .card-header {
    border-bottom: 0;
    padding-bottom: 0;
}

.signin-card #signin-workspace {
    font-weight: 500;
}

.signin-card .form-control {
    background-color: var(--chisel-white);
}

.signin-card-logo {
    display: none;
    width: 148px;
    height: auto;
    margin: 0 auto;
}

.signin-form-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: var(--chisel-paper);
}

.signin-form-panel .signin-card {
    width: 100%;
    max-width: 380px;
}

/* Stack to a single column on tablets / phones, hide the brand panel. */
@media (max-width: 767.98px) {
    .signin-brand {
        display: none;
    }
    .signin-form-panel {
        flex-basis: 100%;
        padding: 2rem 1rem;
    }
    /* The brand panel is hidden here, so the form card carries the signature. */
    .signin-card-logo {
        display: block;
    }
}

/* ---------------------------------------------------------------------------
   Modal backdrop — use a semi-transparent white overlay instead of the default
   dark one.
   --------------------------------------------------------------------------- */
.modal-backdrop {
    background-color: #fff;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* ---------------------------------------------------------------------------
   Forms — required-field indicator. Add class="required" to a field's <label>
   to append a red asterisk.
   --------------------------------------------------------------------------- */
label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: 500;
}

/* ---------------------------------------------------------------------------
   Select2 — align the default and Bootstrap 4 themes with AdminLTE form
   controls (height, borders, focus colour). These rules are the AdminLTE
   recommended fixes so Select2 visually matches .form-control inputs.
   --------------------------------------------------------------------------- */
.select2-container--default .select2-selection--single,
.select2-container--bootstrap4 .select2-selection--single {
    height: calc(2.25rem + 2px);
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.5;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(2.25rem + 2px);
}

/* Multi-select height/spacing to match inputs. */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    min-height: calc(2.25rem + 2px);
}

/* AdminLTE primary colour for selected options and focus states. */
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--bootstrap4 .select2-results__option--highlighted,
.select2-container--bootstrap4 .select2-results__option--highlighted.select2-results__option[aria-selected=true] {
    background-color: var(--chisel-purple);
    color: var(--chisel-white);
}

/* Selects keep their grey border when clicked or open (AdminLTE turns part of it
   blue). Keyboard focus still gets the purple outline below. */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple,
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--multiple:focus,
.select2-container--default .select2-dropdown,
.select2-container--default .select2-dropdown .select2-search__field:focus,
.select2-container--default .select2-search--inline .select2-search__field:focus,
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection {
    border-color: #ced4da;
    box-shadow: none;
}

select.form-control:focus,
.custom-select:focus {
    border-color: var(--chisel-line);
    box-shadow: none;
}

.select2-container--default .select2-selection:focus-visible,
.select2-container--bootstrap4 .select2-selection:focus-visible {
    outline: 3px solid var(--chisel-purple);
    outline-offset: 2px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--chisel-purple);
    border-color: var(--chisel-purple);
    color: #fff;
    padding: 0 0.5rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    margin-right: 0.25rem;
}

/* Make Select2 fill the width of input groups / form rows. */
.select2-container {
    width: 100% !important;
}

/* ---------------------------------------------------------------------------
   DataTables — project standard (see App.dataTable in app.js):
   per-column filter row on desktop, generic search on mobile, horizontal
   scroll instead of the Responsive add-on.
   --------------------------------------------------------------------------- */

/* DataTables' Bootstrap 4 integration zeroes the left, right and bottom border
   widths of .table-bordered cells (it uses separate borders + the table edge),
   which drops the outer left and bottom borders. Force border-collapse and
   restore every cell border width so the full grid is drawn without doubling.
   Each override below mirrors a DataTables rule at matching specificity. */
table.dataTable.table-bordered {
    border-collapse: collapse !important;
}

/* Counter `border-left-width: 0` (and top/right) on all cells. */
table.table-bordered.dataTable th,
table.table-bordered.dataTable td {
    border-width: 1px;
}

/* Counter `border-right-width: 0` on the last column. */
table.table-bordered.dataTable th:last-child,
table.table-bordered.dataTable td:last-child {
    border-right-width: 1px;
}

/* Counter `border-bottom-width: 0` on body cells (restores the bottom border). */
table.table-bordered.dataTable tbody th,
table.table-bordered.dataTable tbody td {
    border-bottom-width: 1px;
}

/* Vertically centre the content of every table cell. */
.table th,
.table td,
table.dataTable th,
table.dataTable td {
    vertical-align: middle;
}

/* Tighten body-cell padding. Header cells keep 0.75rem so the DataTables sort
   arrows stay vertically centred against the heading text. */
.table td,
table.dataTable td {
    padding: 0.5rem;
}

.table th,
table.dataTable th {
    padding: 0.75rem;
}

/* The per-column filter inputs sit in the upper header row. The inputs are
   borderless and transparent so they look built into the table. */
table.dataTable thead tr.dt-column-filters th {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-weight: 400;
}

table.dataTable thead tr.dt-column-filters .dt-filter {
    width: 100%;
    height: auto;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    padding: 0.1rem 0;
    font-weight: 400;
}

table.dataTable thead tr.dt-column-filters .dt-filter:focus {
    outline: 0;
    border: 0;
    box-shadow: none;
    background-color: transparent;
}

/* Generic search is hidden on desktop; shown only on small screens. */
.dt-global-search {
    display: none;
}

/* Actions and Status columns: shrink to the width of their content (buttons /
   badge), never wrap, and centre. The width:1% + white-space:nowrap trick sizes
   the column to its content; the borderless filter input (width:100%) shrinks
   with it rather than forcing the column wider. */
table.dataTable th.dt-actions,
table.dataTable td.dt-actions,
table.dataTable th.dt-status,
table.dataTable td.dt-status {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

table.dataTable td.dt-actions .btn {
    white-space: nowrap;
}

/* A column with many actions (Team): let the buttons wrap onto a second line
   inside a fixed width instead of pushing the table wider than the card. */
table.dataTable td.dt-actions.dt-actions-wrap {
    white-space: normal;
    min-width: 15rem;
    text-align: right;
}

/* Centre status/badge columns (apply className "text-center" to the column).
   !important is needed to beat DataTables' own cell rules. */
table.dataTable tbody td.text-center,
table.dataTable thead th.text-center {
    text-align: center !important;
}

/* On small screens: hide the per-column filter row and show the generic
   search box instead. */
@media (max-width: 767.98px) {
    table.dataTable thead tr.dt-column-filters {
        display: none;
    }
    .dt-global-search {
        display: block;
    }
}

/* ---------------------------------------------------------------------------
   Stage 2: billing, signup and the support notice
   --------------------------------------------------------------------------- */
.chisel-price {
    font-family: 'Spectral', Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.chisel-signup-price {
    font-weight: 500;
}

.badge-warning {
    background-color: #FBF1DC;
    color: #7A5200;
}

.badge-danger {
    background-color: #FBE9E7;
    color: #9B2C2C;
}

.chisel-support-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background-color: var(--chisel-lavender);
    color: var(--chisel-purple);
    font-weight: 500;
}

.signin-form-panel .custom-control-label {
    font-weight: 400;
}

/* ---------------------------------------------------------------------------
   Stage 3: settings and profiles
   --------------------------------------------------------------------------- */
.chisel-logo-preview,
.chisel-photo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
    padding: 0.75rem;
    border: 1px dashed var(--chisel-line);
    border-radius: 0.5rem;
    background-color: var(--chisel-paper);
}

.chisel-logo-preview img {
    max-width: 100%;
    max-height: 8rem;
}

.chisel-photo-preview img {
    max-width: 100%;
    max-height: 14rem;
    border-radius: 0.5rem;
}

.chisel-colour-swatch {
    width: 2.75rem;
    border-left: 0;
}

.chisel-template-body {
    font-family: inherit;
    min-height: 14rem;
}

.btn-xs {
    padding: 0.125rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.custom-file-label,
.custom-file-label::after {
    font-weight: 400;
}

.chisel-checklist a {
    color: var(--chisel-purple);
}

/* Stage 4: notes, quotation lines, queues and job tabs */
.chisel-notes .chisel-note {
    border-left: 3px solid var(--chisel-purple);
    padding: 0.25rem 0 0.25rem 0.75rem;
    margin-bottom: 1rem;
}

.chisel-note-body,
.chisel-pre {
    white-space: pre-wrap;
}

.chisel-lines td {
    vertical-align: top;
}

.chisel-lines textarea {
    min-height: 2.25rem;
}

.chisel-queue h3 {
    font-weight: 500;
}

/* Every tabbed area uses one pattern: a card with the purple top border
   (card card-primary card-outline card-tabs chisel-tab-card), the tabs in its
   header (nav nav-tabs chisel-tabs), and a chisel-pane-title at the top of each
   pane (unless the pane opens with its own titled card). */
.chisel-tab-card > .card-header {
    background: transparent;
}

.chisel-tabs .nav-link {
    color: var(--chisel-ink, #2B2440);
}

.chisel-tabs .nav-link.active {
    color: var(--chisel-purple);
}

.chisel-pane-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--chisel-text);
    margin-bottom: 1rem;
}

/* Job page: readiness checks across the top, one column each on wide screens. */
.chisel-readiness > li {
    min-width: 0;
}

.chisel-readiness-icon {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

@media (max-width: 575.98px) {
    .chisel-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .chisel-tabs .nav-link {
        white-space: nowrap;
    }
}

/* Stage 5: printable Chisel invoice. Plain, black on white, no bold. */
.chisel-print { background: var(--chisel-white); color: var(--chisel-text); }
.chisel-document { position: relative; max-width: 860px; }
.chisel-sign-block { page-break-inside: avoid; break-inside: avoid; }
.chisel-sign-line { border-bottom: 1px solid var(--chisel-text); height: 2.5rem; margin-bottom: .25rem; }
.chisel-print-artwork { max-width: 100%; max-height: 420px; border: 1px solid #dee2e6; }
.chisel-print-logo { display: block; max-height: 64px; max-width: 220px; width: auto; }
.chisel-document h1, .chisel-document h2 { font-weight: 500; }
.chisel-void-mark {
  position: absolute; top: 35%; left: 0; right: 0; text-align: center;
  font-size: 7rem; font-weight: 500; letter-spacing: .2em; color: rgba(160, 40, 40, .18);
  transform: rotate(-18deg); pointer-events: none;
}
@media print {
  .chisel-print { font-size: 11pt; }
  .chisel-document { max-width: none; padding: 0 !important; }
  .chisel-document .table td, .chisel-document .table th { padding: .3rem .4rem; }
}
.chisel-pre-line { white-space: pre-line; }

/* ---------------------------------------------------------------------------
   Customer portal (Stage 6). The business's own colour, when set, replaces the
   top border; everything else stays in the Chisel type and spacing.
   --------------------------------------------------------------------------- */
.chisel-portal { background-color: var(--chisel-paper); color: var(--chisel-text); }
.chisel-portal-header {
  background: var(--chisel-white);
  border-top: 4px solid var(--chisel-purple);
  border-bottom: 1px solid var(--chisel-line);
  padding: .75rem 0;
}
.chisel-portal-container { max-width: 860px; }
.chisel-portal-logo { max-height: 48px; max-width: 160px; width: auto; }
.chisel-portal-image { max-height: 360px; object-fit: contain; }
.chisel-portal h1, .chisel-portal h2, .chisel-portal h3 { font-weight: 500; }
@media print {
  .chisel-portal { background: var(--chisel-white); font-size: 11pt; }
  .chisel-portal-header { border-bottom: 0; }
}

/* Stage 8: visit calendar */
.chisel-calendar { table-layout: fixed; min-width: 760px; }
.chisel-calendar td { height: 7rem; padding: .35rem; }
.chisel-calendar td.chisel-today { background-color: var(--chisel-lavender); }
.chisel-calendar .btn { font-size: .75rem; line-height: 1.2; padding: .2rem .35rem; }

/* Stage 10: fieldwork */
.chisel-id-photo { width: 96px; flex: 0 0 96px; }
.chisel-field-thumb { width: 100%; max-width: 160px; height: auto; }
.chisel-voice-timer { font-variant-numeric: tabular-nums; font-size: 1.5rem; }

/* AI sparkles: marks buttons and titles that use AI. Font Awesome 5 has no
   sparkles icon, so it is drawn here with the curved four-point star of the
   Chisel AI icon, and takes the text colour like the other icons. */
.chisel-ai-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3Q11 12 19 13Q11 14 10 23Q9 14 1 13Q9 12 10 3Z'/%3E%3Cpath d='M19 1Q19.5 4.5 23 5Q19.5 5.5 19 9Q18.5 5.5 15 5Q18.5 4.5 19 1Z'/%3E%3Cpath d='M19.5 16Q19.8 18.2 22 18.5Q19.8 18.8 19.5 21Q19.2 18.8 17 18.5Q19.2 18.2 19.5 16Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3Q11 12 19 13Q11 14 10 23Q9 14 1 13Q9 12 10 3Z'/%3E%3Cpath d='M19 1Q19.5 4.5 23 5Q19.5 5.5 19 9Q18.5 5.5 15 5Q18.5 4.5 19 1Z'/%3E%3Cpath d='M19.5 16Q19.8 18.2 22 18.5Q19.8 18.8 19.5 21Q19.2 18.8 17 18.5Q19.2 18.2 19.5 16Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Platform dashboard figures: DM Sans medium (the app never uses bold), with
   figures of equal width so the numbers line up. */
.chisel-stat {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* Workshop board: five columns side by side on wide screens, stacked on
   narrow ones. The page scrolls the board sideways, never the whole page. */
.chisel-board { display: flex; gap: .75rem; overflow-x: auto; align-items: flex-start; padding-bottom: .5rem; }
.chisel-board-column {
  flex: 1 0 240px; min-width: 240px; background: var(--chisel-lavender);
  border: 1px solid var(--chisel-line); border-radius: .25rem; padding: .5rem;
}
.chisel-board-head h2 { font-weight: 500; }
.chisel-board-card { box-shadow: none; border: 1px solid var(--chisel-line); }
.chisel-board-card a, .chisel-board-ref { font-weight: 500; }
.chisel-board-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 767.98px) {
  .chisel-board { flex-direction: column; overflow-x: visible; }
  .chisel-board-column { width: 100%; min-width: 0; flex-basis: auto; }
}

/* Workshop job sheet artwork: large enough to work from, kept on one page. */
.chisel-sheet-art { max-width: 100%; max-height: 520px; object-fit: contain; border: 1px solid var(--chisel-line); }
@media print { .chisel-sheet-art { max-height: 15cm; } .chisel-sheet-block { page-break-inside: avoid; } }

/* Email log: an email's text, as sent (plain text, wrapped, scrolls if long). */
.chisel-email-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.875rem;
    max-height: 20rem;
    overflow-y: auto;
    background: var(--chisel-paper, #fff);
}

/* Help centre (help.html) */
.help-sidebar { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
.help-nav-list a { display: block; padding: 0.2rem 0.5rem; border-radius: 0.25rem; color: var(--chisel-text); }
.help-nav-list a:hover, .help-nav-list a:focus { background: var(--chisel-lavender); text-decoration: none; }
.help-nav-list a.active { background: var(--chisel-purple); color: var(--chisel-white); }
.help-topic .card-body { max-width: 60rem; }
.help-topic .card-body h3 { margin-top: 1.5rem; }
.help-topic .card-body > h3:first-child, .help-topic .card-body .help-faq h3 { margin-top: 0; }
.help-pager { display: flex; justify-content: space-between; }
.help-topic dt { margin-top: 0.75rem; }
.help-figure { margin: 1.25rem 0; }
.help-figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--chisel-line); border-radius: 0.35rem;
    box-shadow: 0 1px 4px rgba(19, 16, 28, 0.08); }
.help-figure figcaption { margin-top: 0.4rem; font-size: 0.875rem; color: var(--chisel-muted); }
.help-figure-phone img { max-width: 20rem; }
.help-journey li, .help-steps li { margin-bottom: 0.5rem; }
.help-faq .card-header { background: transparent; }
.help-faq-toggle { color: var(--chisel-text); font-weight: 500; white-space: normal; padding: 0.75rem 1rem; }
.help-faq-toggle:hover, .help-faq-toggle:focus { color: var(--chisel-purple); text-decoration: none; }
.help-faq-toggle { display: flex; justify-content: space-between; align-items: center; }
.help-faq-chevron { margin-left: 0.5rem; flex-shrink: 0; transition: transform 0.2s; }
.help-faq-toggle.collapsed .help-faq-chevron { transform: rotate(-90deg); }
.help-result-title { font-weight: 500; }
.help-result mark, .help-topic mark { background: var(--chisel-lavender); padding: 0 0.1em; }
.help-pager .btn { white-space: normal; max-width: 48%; }
@media (max-width: 991.98px) {
    .help-sidebar { position: static; max-height: none; }
}
@media print {
    .help-sidebar, .help-pager { display: none !important; }
}

/* ---------------------------------------------------------------------------
   Dashboard headline numbers and fold-away cards (12 November 2026).
   --------------------------------------------------------------------------- */
/* Only the clickable tenant-dashboard cards (a.card.chisel-stat) get a
   border and hover; plain figures that share .chisel-stat for the font must
   not (13 November 2026). */
.card.chisel-stat {
    display: block;
    color: var(--chisel-text);
    border: 1px solid var(--chisel-line);
    box-shadow: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.card.chisel-stat:hover,
.card.chisel-stat:focus {
    color: var(--chisel-text);
    text-decoration: none;
    border-color: var(--chisel-purple);
    background-color: var(--chisel-white);
}

.chisel-stat .card-body {
    padding: 1rem 1.1rem;
}

.chisel-stat-label {
    color: var(--chisel-purple);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    min-height: 2.6em;
}

.chisel-stat-value {
    margin: 0.35rem 0 0.2rem;
    font-size: 2.1rem;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--chisel-text);
    white-space: nowrap;
}

.chisel-stat-note {
    color: var(--chisel-muted);
    font-size: 0.8125rem;
    line-height: 1.3;
}

.chisel-stat-note.text-warning-dark {
    color: #7A5200;
}

.chisel-card-toggle {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--chisel-text);
    font-size: inherit;
    font-weight: inherit;
    border: 0;
}

.chisel-card-toggle:hover,
.chisel-card-toggle:focus {
    color: var(--chisel-purple);
    text-decoration: none;
}

.chisel-card-chevron {
    transition: transform 0.2s;
}

.chisel-card-toggle.collapsed .chisel-card-chevron {
    transform: rotate(-90deg);
}

@media (max-width: 575.98px) {
    .chisel-stat-value { font-size: 1.6rem; }
}

/* ---------------------------------------------------------------------------
   Platform dashboard: section cards, tiles, panels and campaigns (13 November 2026).
   --------------------------------------------------------------------------- */
.chisel-section > .card-header { border-bottom: 1px solid var(--chisel-line); min-height: 3.4rem; display: flex; flex-wrap: wrap; align-items: center; }
.chisel-section-title { float: none; font-size: 1.05rem; font-weight: 500; color: var(--chisel-text); }
.chisel-section-title .fas { color: var(--chisel-purple); }

.chisel-funnel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.chisel-funnel-step { position: relative; padding: .85rem 1rem; background: var(--chisel-paper); border: 1px solid var(--chisel-line); border-radius: .5rem; }
.chisel-funnel-step p { margin: 0; }
.chisel-funnel-label { color: var(--chisel-muted); font-size: .8125rem; line-height: 1.3; min-height: 2.6em; }
.chisel-funnel-value { font-size: 1.75rem; line-height: 1.15; margin: .25rem 0 .15rem !important; color: var(--chisel-text); }
.chisel-funnel-rate { color: var(--chisel-purple); font-size: .8125rem; line-height: 1.3; }
.chisel-funnel-goal { background: var(--chisel-lavender); border-color: var(--chisel-lilac); }
.chisel-funnel-goal .chisel-funnel-label { color: var(--chisel-purple); }
@media (max-width: 991.98px) { .chisel-funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .chisel-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.chisel-panel { border: 1px solid var(--chisel-line); border-radius: .5rem; overflow: hidden; background: var(--chisel-white); }
.chisel-panel-title { margin: 0; padding: .6rem .9rem; font-size: .875rem; font-weight: 500; color: var(--chisel-purple); background: var(--chisel-paper); border-bottom: 1px solid var(--chisel-line); }
.chisel-panel .table { font-variant-numeric: tabular-nums; }
.chisel-panel .table th { border-top: 0; color: var(--chisel-muted); font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.chisel-panel .table th:first-child, .chisel-panel .table td:first-child { padding-left: .9rem; }
.chisel-panel .table th:last-child, .chisel-panel .table td:last-child { padding-right: .9rem; }
.chisel-panel-empty { margin: 0; padding: .9rem; color: var(--chisel-muted); font-size: .875rem; }

.chisel-campaign-settings { border-top: 1px solid var(--chisel-line); padding-top: .75rem; }
.chisel-campaign-settings > summary { cursor: pointer; color: var(--chisel-purple); font-weight: 500; font-size: .9rem; }
.chisel-campaign-snippet { background: var(--chisel-paper); border: 1px solid var(--chisel-line); border-radius: .375rem; padding: .6rem .75rem; font-size: .8125rem; white-space: pre-wrap; word-break: break-all; }

/* Plain figure tiles shared by every platform dashboard section. */
.chisel-tiles { display: grid; gap: .75rem; }
.chisel-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chisel-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 767.98px) { .chisel-tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .chisel-tiles-2 { grid-template-columns: minmax(0, 1fr); } }
.chisel-tile { padding: .85rem 1rem; background: var(--chisel-paper); border: 1px solid var(--chisel-line); border-radius: .5rem; }
.chisel-tile > p { margin: 0; }
.chisel-tile-label { color: var(--chisel-muted); font-size: .8125rem; line-height: 1.3; }
.chisel-tile-value { font-size: 1.75rem; line-height: 1.15; margin-top: .25rem !important; color: var(--chisel-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chisel-tile-of { font-size: 1rem; color: var(--chisel-muted); }
.chisel-tile-goal { background: var(--chisel-lavender); border-color: var(--chisel-lilac); }
.chisel-tile-goal .chisel-tile-label { color: var(--chisel-purple); }
.chisel-tile-bar { height: 6px; margin-top: .6rem; background: var(--chisel-line); }
.chisel-tile-bar .progress-bar { background-color: var(--chisel-purple); }
.chisel-tile-bar .progress-bar.bg-warning { background-color: #E0A100 !important; }
.chisel-tile-bar .progress-bar.bg-danger { background-color: #C0392B !important; }
.chisel-section.border-warning > .card-header { border-bottom-color: #E0A100; }
.chisel-section.border-danger > .card-header { border-bottom-color: #C0392B; }

/* Platform dashboard: needs attention, system health, workspace activity. */
.chisel-section > .card-header .badge.d-none { display: none !important; }
.chisel-attention-item, .chisel-health-item { display: flex; align-items: flex-start; padding: .75rem 1.25rem; border-bottom: 1px solid var(--chisel-line); }
.chisel-attention-item:last-child, .chisel-health-item:last-child { border-bottom: 0; }
.chisel-attention-item > .fas, .chisel-health-item > .fas { margin-top: .2rem; font-size: 1rem; }
.chisel-attention-item p, .chisel-health-item p { margin: 0; }
.chisel-attention-who { font-weight: 500; }
.chisel-attention-text { font-size: .875rem; color: var(--chisel-text); }
.chisel-attention-meta { font-size: .8125rem; color: var(--chisel-muted); }
.chisel-health-label { font-weight: 500; }
.chisel-health-detail { font-size: .875rem; color: var(--chisel-muted); }
.is-danger > .fas { color: #C0392B; }
.is-warning > .fas { color: #B07D00; }
.is-ok > .fas { color: #2E7D4F; }
.is-info > .fas { color: var(--chisel-purple); }
.is-off > .fas { color: var(--chisel-muted); }
.chisel-attention-item.is-danger { background: #FDF3F2; }
.chisel-setup-bar { width: 5rem; flex: none; }
.chisel-row-quiet td { background: #FFFBEF; }
