/* App-specific additions not covered by backend-min itself. */

/* Widen the main content column beyond backend-min's default 1280px cap. */
.page-body .container-xl,
.page-header .container-xl,
.navbar:not(.navbar-vertical) .container-xl {
    width: min(1600px, calc(100% - 32px));
}

/* backend-min's base.css resets ALL <input> elements (display:block, width:100%,
   appearance:none) — fine for text/number/select, but breaks checkboxes/radios. Rebuilt as
   real Bootstrap-style checkbox/radio controls (own box + SVG checkmark/dot on :checked)
   instead of leaving it to the browser's native `accent-color` rendering, which is too subtle
   to read as "selected" at a glance (direct user request, 2026-09-01) — a solid var(--primary)
   fill makes the checked state unmistakable, matching Bootstrap's own .form-check-input. */
input[type="checkbox"],
input[type="radio"] {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    margin: 0;
    padding: 0;
    appearance: none;
    background-color: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 0.25em;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color var(--t), border-color var(--t);
}
input[type="radio"] {
    border-radius: 50%;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.7em;
}
input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}
input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(32, 107, 196, 0.25);
}
.form-check {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 10px;
    margin-top: 0px;
}
/* .form-check sets a horizontal gap between its own checkbox+label, but nothing separated
   consecutive rows — checkbox lists (e.g. Pipeline Grouping's Status/Stage checklists,
   leads/edit.html.twig's Quotable/Customer Type radios) stack one `.form-check` div per line, so
   a *horizontal* margin here (bug fixed 2026-09-01) misaligned every row after the first — only
   the first row sat flush left, every later one sat 15px further right. Vertical spacing between
   stacked rows is what's actually needed. */
.form-check + .form-check {
    margin-top: 6px;
    margin-left: 0px;
}
.form-check-label { margin: 0; }

/* Form validation error state — backend-min ships no .is-invalid style. */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
}
.field-error,
.text-danger.field-error {
    display: block;
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 4px;
}

/* Admin login/forgot-password/reset-password cards — backend-min's .auth-wrap
   ships with no width rule, so it shrink-wraps to content. Match the user
   side's .auth-shell-inner (400px) instead of leaving it narrower. */
.auth-wrap {
    width: 100%;
    max-width: 400px;
}

/* Instance name shown above the login/forgot/reset cards (auth_logo block in
   base_admin.html.twig) — backend-min ships no login-page branding element at all. */
.auth-logo {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
}

/* Drag-and-drop reorder handle (Pipeline Grouping edit page's group rows, direct user request). */
.drag-handle-cell {
    cursor: grab;
    text-align: center;
    color: var(--muted-soft);
    width: 32px;
}
tr.pipeline-grouping-group-row:active .drag-handle-cell {
    cursor: grabbing;
}

/* Person icon shown in place of a nameless/emailless contact's link text (GHL Opportunities list,
   direct user request) -- Tabler's default .avatar-sm icon size reads too small and sits slightly
   off the table row's text baseline; bumping the icon size and centering it vertically lines it up
   with the rest of the row's plain-text links. */
.contact-icon-avatar {
    font-size: 1.25rem;
    vertical-align: middle;
}

/* Google Ads export log tables (New Leads/Lead Adjustments) have many columns and several with
   long, space-less values (hashes, order ids, gclids, emails) -- table-layout:fixed plus each
   column's explicit width (set on <th> in the template) keeps the whole table within the
   viewport with no horizontal scroll no matter how long any single value is; word-break lets
   those values wrap inside their own column instead of overflowing it. */
.google-export-table {
    table-layout: fixed;
    width: 100%;
}
.google-export-table td,
.google-export-table th {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Email Hash/Phone Hash and Order ID/Google Click ID have no natural break points at all (unlike
   emails, which at least break on ".") -- word-break: break-word above isn't enough for those,
   they need break-all. Widths themselves come from the <th> percentages, not from these classes
   (direct user request: hash columns wider, order id/gclid columns narrower). */
.hash-cell,
.id-cell {
    display: block;
    word-break: break-all;
}

/* Impersonation banners — app-specific, not part of the design system. */
.impersonation-banner,
.admin-impersonation-banner {
    background: var(--warning);
    color: #1f2933;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
}
.impersonation-banner .exit-impersonation-btn,
.admin-impersonation-banner .exit-admin-impersonation-btn {
    margin-left: 8px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 10px;
    font-size: 0.8125rem;
    cursor: pointer;
}
