/*
 * qwx theme for the Webhooks pages (index.html and docs/index.html; both set html.qwx).
 *
 * The look of QuoteWerks Web's qwx screens: the page colour, fields, buttons, switches, the event and
 * macro pickers, notes, toasts and the read-only code boxes. The pieces the page is built from (cards,
 * grid cards, the parent tabs, the modal frame) are in qwx-components.css.
 *
 * The values are QWW's (QuoteWerksWeb.Web/app/components/qwx/qwx.css, 2026-11-17), copied by hand as
 * the Settings Service's theme is: keep them in step when the kit changes. Everything is under
 * html.qwx so these rules outrank Bootstrap 5's whatever order the sheets load in. Light mode only.
 *
 * Not restyled: the CodeMirror body editors (the dracula theme and the macro colours in style.css).
 */

/* ===================================================================== tokens and the page */

html.qwx {
    --qwx-blue: #1d69ba;
    --qwx-blue-dark: #135397;
    --qwx-blue-soft: #e9f2ff;
    --qwx-blue-line: #b8d2f3;
    --qwx-ink: #1a2c45;
    --qwx-text: #31445d;
    --qwx-muted: #65758b;
    --qwx-line: #dce4ee;
    --qwx-line-soft: #ebeff4;
    --qwx-bg: #f5f7fa;
    --qwx-card: #ffffff;
    --qwx-radius: 8px;
    --qwx-radius-sm: 6px;
    --qwx-shadow: 0 2px 10px rgba(28, 43, 67, .045);
    --qwx-toggle-on: #0d9488;
    --qwx-toggle-focus: #7fd0c7;
    --qwx-grid-divider: #a9b7c7;
    --qwx-row-selected: #daeafc;
    --qwx-field-h: 28px;
    --qwx-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --qwx-mono: Consolas, Monaco, "Lucida Console", monospace;
}

html.qwx body {
    padding: 0;
    background-color: var(--qwx-bg);
    font-family: var(--qwx-font);
    font-size: 13px;
    color: var(--qwx-text);
}

html.qwx a {
    color: var(--qwx-blue);
}

html.qwx a:hover {
    color: var(--qwx-blue-dark);
}

/* ===================================================================== form bits */

/* the kit's field box: one compact height for inputs and selects */
html.qwx .form-control,
html.qwx .form-select {
    height: var(--qwx-field-h);
    min-height: 0;
    padding: 4px 8px;
    line-height: 18px;
    border-color: #ccd7e3;
    border-radius: 5px;
    box-shadow: none;
    font-size: 12px;
    color: #344861;
}

html.qwx .form-select {
    padding-right: 28px;
    background-position: right 8px center;
    background-size: 12px 10px;
}

html.qwx textarea.form-control {
    height: auto;
    padding: 5px 8px;
}

html.qwx .form-control::placeholder {
    color: #97a6b8;
}

html.qwx .form-control:focus,
html.qwx .form-select:focus {
    border-color: #70a9e4;
    box-shadow: 0 0 0 2px #e7f3ff;
}

html.qwx .form-control[disabled],
html.qwx .form-control[readonly],
html.qwx .form-select[disabled] {
    background-color: #f3f6f9;
    color: var(--qwx-muted);
}

/* an input group's icon or unit: the field's height, the kit's grey */
html.qwx .input-group-text {
    padding: 4px 8px;
    border-color: #ccd7e3;
    background-color: #f3f6f9;
    color: #7a8ba0;
    font-size: 12px;
    line-height: 18px;
}

/* A field's caption: the kit's small, strong, slate caption. */
html.qwx label {
    margin: 0;
    color: #526782;
    font-size: 12px;
    font-weight: 600;
}

/* ---- switches. Rule: an on/off option is a switch, not a tick box. Every checkbox on these pages
   is one (Enabled, Send to a custom URL), so a plain checkbox is drawn as a switch and ng-model and
   ng-change work unchanged. */
html.qwx input[type=checkbox] {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    height: 18px;
    margin: 0;
    border: 0;
    border-radius: 9px;
    background-color: #c3cdd9;
    cursor: pointer;
    transition: background-color .2s;
    vertical-align: middle;
}

html.qwx input[type=checkbox]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: left .2s;
}

html.qwx input[type=checkbox]:checked {
    background-color: var(--qwx-toggle-on);
}

html.qwx input[type=checkbox]:checked::after {
    left: 16px;
}

html.qwx input[type=checkbox]:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* no ring from a click; tabbing to it shows the teal ring */
html.qwx input[type=checkbox]:focus {
    outline: none;
}

html.qwx input[type=checkbox]:focus-visible {
    outline: 2px solid var(--qwx-toggle-focus);
    outline-offset: 2px;
}

/* a switch and its text: <label class="qwx-switch-label"><input type="checkbox"><span>…</span></label> */
html.qwx .qwx-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--qwx-text);
    font-weight: 400;
    cursor: pointer;
}

/* ===================================================================== buttons */

/* The field's height, so a button stands as high as the field beside it. btn-default is the kit's
   outlined button (Bootstrap 5 has none of its own). */
html.qwx .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--qwx-field-h);
    padding: 4px 12px;
    border-radius: var(--qwx-radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}

html.qwx .btn > i {
    font-size: 13px;
}

html.qwx .btn:focus-visible {
    box-shadow: 0 0 0 2px #cfe2f8;
}

html.qwx .btn-default {
    background-color: #fff;
    border-color: #cad6e5;
    color: #275076;
}

html.qwx .btn-default:hover,
html.qwx .btn-default:focus {
    background-color: #f0f6ff;
    border-color: #a9c4e3;
    color: #1d4f80;
}

html.qwx .btn-primary {
    background-color: var(--qwx-blue);
    border-color: var(--qwx-blue);
    color: #fff;
}

html.qwx .btn-primary:hover,
html.qwx .btn-primary:focus,
html.qwx .btn-primary:active {
    background-color: var(--qwx-blue-dark);
    border-color: var(--qwx-blue-dark);
    color: #fff;
}

/* a destructive action: solid as the confirmation's own button, outlined beside other buttons */
html.qwx .btn-danger {
    background-color: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

html.qwx .btn-danger:hover,
html.qwx .btn-danger:focus {
    background-color: #a5281c;
    border-color: #a5281c;
    color: #fff;
}

html.qwx .btn-default.qwx-btn-danger {
    color: #b42323;
}

html.qwx .btn-default.qwx-btn-danger:hover,
html.qwx .btn-default.qwx-btn-danger:focus {
    background-color: #fdf1f0;
    border-color: #e3b4b0;
    color: #9a1c1c;
}

html.qwx .btn:disabled,
html.qwx .btn.disabled {
    opacity: .45;
}

/* QWW's outlined grid buttons (qw-gridcontrols in a qwx card): 30px square, the icon alone */
html.qwx .btn.qwx-tool {
    height: 30px;
    background-color: #fff;
    border-color: #cad6e5;
    color: #275076;
}

html.qwx .btn.qwx-tool.qwx-tool-icon {
    width: 30px;
    padding: 0;
}

html.qwx .btn.qwx-tool > i {
    font-size: 14px;
}

html.qwx .btn.qwx-tool:hover,
html.qwx .btn.qwx-tool:focus {
    background-color: #f0f6ff;
    border-color: #a9c4e3;
    color: #1d4f80;
}

html.qwx .btn.qwx-tool.qwx-btn-danger {
    color: #b42323;
}

html.qwx .btn.qwx-tool.qwx-btn-danger:hover,
html.qwx .btn.qwx-tool.qwx-btn-danger:focus {
    background-color: #fdf1f0;
    border-color: #e3b4b0;
    color: #9a1c1c;
}

/* in a grid row: a little smaller, so the row keeps its height */
html.qwx .qwx-table .btn.qwx-tool {
    width: 26px;
    height: 24px;
}

html.qwx .qwx-table .btn.qwx-tool > i {
    font-size: 12px;
}

/* ===================================================================== the event and macro pickers */

/* searchable-select and macro-inserter (app.js): a search field and a list dropping below it */
html.qwx .qwx-picker {
    position: relative;
}

html.qwx .qwx-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 3px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--qwx-line);
    border-radius: var(--qwx-radius-sm);
    background-color: #fff;
    box-shadow: 0 8px 24px rgba(15, 30, 55, .14);
}

html.qwx .qwx-dropdown-item {
    padding: 6px 12px;
    border-bottom: 1px solid var(--qwx-line-soft);
    cursor: pointer;
}

html.qwx .qwx-dropdown-item:last-child {
    border-bottom: 0;
}

html.qwx .qwx-dropdown-item.qwx-active {
    background-color: #f2f8ff;
    box-shadow: inset 3px 0 0 var(--qwx-blue);
}

html.qwx .qwx-dropdown-name {
    color: var(--qwx-ink);
    font-size: 12px;
    font-weight: 600;
}

html.qwx .qwx-dropdown-desc {
    color: var(--qwx-muted);
    font-size: 11px;
}

html.qwx .qwx-dropdown-empty {
    padding: 12px;
    color: var(--qwx-muted);
    font-size: 12px;
    text-align: center;
}

/* a small tag beside a name ("List") */
html.qwx .qwx-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 9px;
    background-color: var(--qwx-blue-soft);
    color: var(--qwx-blue-dark);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    vertical-align: 1px;
}

/* ===================================================================== hints, notes and code */

html.qwx .qwx-hint {
    color: var(--qwx-muted);
    font-size: 12px;
    line-height: 1.45;
}

html.qwx .qwx-hint > i {
    margin-right: 4px;
    color: #c08a18;
}

/* a note set off from the form: blue for guidance, amber (.qwx-note-warn) for a caution */
html.qwx .qwx-note {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--qwx-blue-line);
    border-radius: var(--qwx-radius-sm);
    background-color: #f3f8ff;
    color: var(--qwx-text);
    font-size: 12px;
    line-height: 1.5;
}

html.qwx .qwx-note > i {
    margin-top: 2px;
    color: #2879c6;
}

html.qwx .qwx-note-warn {
    border-color: #ecd59a;
    background-color: #fdf7e6;
    color: #6b4f00;
}

html.qwx .qwx-note-warn > i {
    color: #c08a18;
}

/* A read-only code box (a delivery's body and source data, an attempt's error): monospace on its
   own light panel, scrolling inside itself. The editable bodies are CodeMirror's (style.css). */
html.qwx .qwx-code {
    margin: 0;
    padding: 10px 12px;
    overflow: auto;
    border: 1px solid var(--qwx-line);
    border-radius: var(--qwx-radius-sm);
    background-color: #f8f9fb;
    color: #24292f;
    font-family: var(--qwx-mono);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===================================================================== toasts */

/* NotificationService's messages: a white card at the top right, a coloured bar and icon for its kind */
html.qwx .qwx-toasts {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 200100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 340px;
    max-width: calc(100vw - 24px);
    pointer-events: none;
}

html.qwx .qwx-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--qwx-line);
    border-radius: var(--qwx-radius);
    background-color: #fff;
    box-shadow: 0 8px 24px rgba(15, 30, 55, .16), inset 3px 0 0 var(--qwx-blue);
    color: var(--qwx-text);
    font-size: 12px;
    pointer-events: auto;
}

html.qwx .qwx-toast > i {
    margin-top: 1px;
    font-size: 15px;
    color: var(--qwx-blue);
}

html.qwx .qwx-toast-text {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

html.qwx .qwx-toast-success { box-shadow: 0 8px 24px rgba(15, 30, 55, .16), inset 3px 0 0 #1d7a36; }
html.qwx .qwx-toast-success > i { color: #1d7a36; }
html.qwx .qwx-toast-warning { box-shadow: 0 8px 24px rgba(15, 30, 55, .16), inset 3px 0 0 #c08a18; }
html.qwx .qwx-toast-warning > i { color: #c08a18; }
html.qwx .qwx-toast-danger { box-shadow: 0 8px 24px rgba(15, 30, 55, .16), inset 3px 0 0 #b42323; }
html.qwx .qwx-toast-danger > i { color: #b42323; }

html.qwx .qwx-toast-close {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: -2px -2px 0 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #8a9ab0;
    font-size: 12px;
}

html.qwx .qwx-toast-close:hover {
    background-color: #eef2f7;
    color: var(--qwx-ink);
}
