/* ============================================================================
   ByQuality AI Rules page (/airules) - company-defined rules every AI
   conversation must obey. All selectors are scoped under .bqrl-wrap so nothing
   leaks into the rest of the app. Brand: red #C70307, charcoal #18181F, Outfit
   (local variable font declared in _Master.cshtml) for labels, theme Inter for
   data. Same conventions as bq-product-settings.css / bq-permissions.css.
   ========================================================================== */

.bqrl-wrap {
    --bqrl-red: #C70307;
    --bqrl-red-dark: #A00206;
    --bqrl-red-tint: #FDEDEC;
    --bqrl-char-1: #22222B;
    --bqrl-char-2: #18181F;
    --bqrl-ink: #1A1A20;
    --bqrl-ink-2: #2B2B31;
    --bqrl-gray: #6C6C74;
    --bqrl-gray-light: #9A9AA2;
    --bqrl-line: #DDDAD5;
    --bqrl-line-soft: #E8E6E2;
    --bqrl-paper: #F4F3F1;
    --bqrl-chip: #F1EFEB;
    --bqrl-ok: #2E7D4F;
    --bqrl-head: 'Outfit', Helvetica, Arial, sans-serif;
    --bqrl-body: Inter, 'Open Sans', Arial, sans-serif;

    min-height: 100%;
    background: var(--bqrl-paper);
    font-family: var(--bqrl-body);
    font-size: 13px;
    color: var(--bqrl-ink-2);
}

/* ============ top band ============ */
.bqrl-topbar {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(180deg, var(--bqrl-char-1), var(--bqrl-char-2));
    border-bottom: 3px solid var(--bqrl-red);
    padding: 0 22px; min-height: 62px; color: #C8C9C7;
    flex-wrap: wrap;
}
.bqrl-ident { display: flex; flex-direction: column; line-height: 1.15; }
.bqrl-kicker {
    font-family: var(--bqrl-head); font-size: 10px; font-weight: 500;
    letter-spacing: .24em; text-transform: uppercase; color: #8E8E96; white-space: nowrap;
}
.bqrl-title { font-family: var(--bqrl-head); font-size: 19px; font-weight: 600; color: #fff; letter-spacing: .02em; }
.bqrl-tb-spacer { flex: 1; }
.bqrl-company { display: flex; align-items: center; gap: 9px; }
.bqrl-company img { width: 26px; height: 26px; border-radius: 5px; background: #fff; object-fit: contain; }
.bqrl-company select {
    font-family: var(--bqrl-head); font-size: 12px; font-weight: 500; letter-spacing: .04em;
    background: transparent; color: #E8E8EA;
    border: 1px solid rgba(255,255,255,.22); border-radius: 7px;
    padding: 8px 12px; cursor: pointer; outline: none;
}
.bqrl-company select:hover { border-color: rgba(255,255,255,.5); }
.bqrl-company select option { color: var(--bqrl-ink); background: #fff; }
.bqrl-tb-btn {
    font-family: var(--bqrl-head); font-size: 11.5px; font-weight: 500;
    letter-spacing: .06em; text-transform: uppercase;
    background: transparent; color: #C8C9C7;
    border: 1px solid rgba(255,255,255,.22); border-radius: 7px;
    padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    white-space: nowrap;
}
.bqrl-tb-btn:hover { border-color: rgba(255,255,255,.5); color: #fff; background: rgba(255,255,255,.04); }
.bqrl-tb-btn:disabled { opacity: .45; cursor: default; }

/* ============ body ============ */
.bqrl-body { max-width: 980px; margin: 0 auto; padding: 22px 22px 60px; }

.bqrl-intro {
    display: flex; gap: 14px; align-items: flex-start;
    background: #fff; border: 1px solid var(--bqrl-line); border-left: 3px solid var(--bqrl-red);
    border-radius: 9px; padding: 15px 17px; margin-bottom: 18px;
    line-height: 1.55;
}
.bqrl-intro-icon { color: var(--bqrl-red); flex: 0 0 auto; margin-top: 2px; }
.bqrl-intro-text b { font-family: var(--bqrl-head); font-weight: 600; color: var(--bqrl-ink); display: block; margin-bottom: 2px; }
.bqrl-refusal { font-style: italic; color: var(--bqrl-red-dark); white-space: nowrap; }

.bqrl-error {
    background: var(--bqrl-red-tint); border: 1px solid #F2C1C0; color: var(--bqrl-red-dark);
    border-radius: 7px; padding: 10px 14px; margin: 0 0 14px; line-height: 1.5;
}

/* ============ toolbar ============ */
.bqrl-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bqrl-count {
    font-family: var(--bqrl-head); font-size: 11px; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase; color: var(--bqrl-gray);
}
.bqrl-tbar-spacer { flex: 1; }
.bqrl-btn {
    font-family: var(--bqrl-head); font-size: 11.5px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    background: var(--bqrl-red); color: #fff;
    border: 1px solid var(--bqrl-red); border-radius: 7px;
    padding: 9px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    white-space: nowrap;
}
.bqrl-btn:hover { background: var(--bqrl-red-dark); border-color: var(--bqrl-red-dark); }
.bqrl-btn:disabled { opacity: .5; cursor: default; }
.bqrl-btn.ghost { background: #fff; color: var(--bqrl-ink); border-color: var(--bqrl-line); }
.bqrl-btn.ghost:hover { border-color: var(--bqrl-gray); background: var(--bqrl-chip); }
.bqrl-btn.danger { background: var(--bqrl-red); border-color: var(--bqrl-red); }

/* ============ list ============ */
.bqrl-list { background: #fff; border: 1px solid var(--bqrl-line); border-radius: 9px; overflow: hidden; }
.bqrl-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 13px 16px; border-bottom: 1px solid var(--bqrl-line-soft);
}
.bqrl-row:last-child { border-bottom: none; }
.bqrl-row.off .bqrl-text, .bqrl-row.off .bqrl-num { color: var(--bqrl-gray-light); }
.bqrl-num {
    font-family: var(--bqrl-head); font-size: 12px; font-weight: 600; color: var(--bqrl-gray);
    background: var(--bqrl-chip); border-radius: 6px;
    min-width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto; margin-top: 1px;
}
.bqrl-text { flex: 1; line-height: 1.55; padding-top: 4px; white-space: pre-wrap; word-break: break-word; }
.bqrl-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }

.bqrl-ico {
    width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--bqrl-gray);
    border: 1px solid var(--bqrl-line); border-radius: 6px; cursor: pointer;
}
.bqrl-ico:hover { color: var(--bqrl-ink); border-color: var(--bqrl-gray); }
.bqrl-ico:disabled { opacity: .35; cursor: default; }
.bqrl-ico.danger:hover { color: var(--bqrl-red); border-color: var(--bqrl-red); background: var(--bqrl-red-tint); }

.bqrl-toggle {
    width: 38px; height: 22px; border-radius: 11px; border: 1px solid var(--bqrl-line);
    background: var(--bqrl-chip); cursor: pointer; position: relative; padding: 0;
    flex: 0 0 auto;
}
.bqrl-toggle .bqrl-knob {
    position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 1px solid var(--bqrl-line); transition: left .15s ease;
}
.bqrl-toggle.on { background: var(--bqrl-ok); border-color: var(--bqrl-ok); }
.bqrl-toggle.on .bqrl-knob { left: 18px; border-color: #fff; }
.bqrl-toggle:disabled { opacity: .5; cursor: default; }

.bqrl-empty {
    background: #fff; border: 1px dashed var(--bqrl-line); border-radius: 9px;
    padding: 36px 20px; text-align: center; color: var(--bqrl-gray); line-height: 1.6;
}

/* ============ popup ============ */
.bqrl-overlay {
    position: fixed; inset: 0; background: rgba(24,24,31,.45);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    font-family: var(--bqrl-body, Inter, 'Open Sans', Arial, sans-serif); font-size: 13px;
}
.bqrl-pop {
    background: #fff; border-radius: 11px; width: 100%; max-width: 560px;
    box-shadow: 0 18px 50px rgba(0,0,0,.28); overflow: hidden;
    color: #2B2B31;
}
.bqrl-pop-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #E8E6E2;
}
.bqrl-pop-title { font-family: 'Outfit', Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 600; color: #1A1A20; }
.bqrl-pop-body { padding: 16px 18px; }
.bqrl-pop-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 13px 18px; border-top: 1px solid #E8E6E2; background: #FAF9F8;
}
.bqrl-label {
    font-family: 'Outfit', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase; color: #6C6C74;
    display: block; margin-bottom: 6px;
}
.bqrl-input {
    width: 100%; border: 1px solid #DDDAD5; border-radius: 7px; padding: 10px 12px;
    font-family: inherit; font-size: 13px; line-height: 1.5; color: #1A1A20;
    resize: vertical; outline: none; box-sizing: border-box;
}
.bqrl-input:focus { border-color: #C70307; box-shadow: 0 0 0 3px rgba(199,3,7,.08); }
.bqrl-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; cursor: pointer; color: #2B2B31; }
.bqrl-check input { accent-color: #2E7D4F; width: 15px; height: 15px; }
.bqrl-pop .bqrl-error { margin: 12px 0 0; }
.bqrl-del-text { margin-bottom: 10px; line-height: 1.5; }
.bqrl-del-quote {
    background: #F1EFEB; border-left: 3px solid #C70307; border-radius: 0 7px 7px 0;
    padding: 10px 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}

/* ============ loader ============ */
.bqrl-loader { display: flex; justify-content: center; padding: 56px 0; }
.bqrl-ring {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid #E8E6E2; border-top-color: #C70307;
    animation: bqrl-spin .8s linear infinite;
}
@keyframes bqrl-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
    .bqrl-body { padding: 16px 12px 50px; }
    .bqrl-row { flex-wrap: wrap; }
    .bqrl-actions { width: 100%; justify-content: flex-end; }
}
