/* Auditor Owl: what is not in GRC Owl's stylesheets. Colours come from their tokens so both themes work. */
.ao-wordmark { font-weight: 700; letter-spacing: -.01em; color: #0b223d; }
.ao-wordmark span { color: #b8662e; }
.ao-crumb { font-size: .875rem; margin-bottom: .35rem; }
.ao-crumb a { text-decoration: none; }
.ao-crumb a:hover { text-decoration: underline; }
.ao-card { transition: box-shadow .15s ease, transform .15s ease; }
.ao-card:hover, .ao-card:focus-visible { box-shadow: 0 6px 20px rgba(15, 29, 51, .12); transform: translateY(-1px); }
.ao-monogram { flex: 0 0 auto; width: 2.75rem; height: 2.75rem; border-radius: .6rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.15rem; background: #e6eefa; color: #12335e; }
.ao-num { font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.ao-feed { max-height: 34rem; overflow-y: auto; }
.ao-internal .comment-main { background: #fff8e1; border-color: #f0d98a; }
.min-w-0 { min-width: 0; }
.form-section { font-weight: 600; border-bottom: 1px solid #e2e6ec; padding-bottom: .35rem; }
.people-picker, .ao-frameworks { border: 1px solid #d5dbe5; border-radius: .5rem; max-height: 13rem; overflow-y: auto; background: #fff; }
.ao-frameworks { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); max-height: 17rem; }
.people-picker-item { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .75rem; cursor: pointer; margin: 0; }
.people-picker-item:hover { background: #f3f6fb; }
.people-picker-item .form-check-input { flex: 0 0 auto; margin-top: .2rem; }
.ao-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; }
.ao-source { position: relative; display: flex; flex-direction: column; gap: .15rem; border: 1px solid #d5dbe5; border-radius: .6rem; padding: .85rem 1rem; cursor: pointer; background: #fff; }
.ao-source input { position: absolute; top: .9rem; right: .9rem; }
.ao-source i { font-size: 1.25rem; color: #12335e; }
.ao-source small { color: #5d6a80; }
.ao-source:has(input:checked) { border-color: #2f7fd1; box-shadow: 0 0 0 1px #2f7fd1 inset; background: #f4f8fe; }
.ao-source:has(input:focus-visible) { outline: 2px solid #2f7fd1; outline-offset: 2px; }
/* the firm's name can be long: one line, cut with an ellipsis (the full name is the tooltip) */
.x-brand { flex-wrap: wrap; row-gap: 0; }
.x-brand .x-name { white-space: nowrap; }
.x-brand .instance-badge, .navbar-brand .instance-badge { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-brand .instance-badge { margin-left: 0; }
.comment-head .comment-date { margin-left: .5rem; }
/* co-branding: the audit firm next to Auditor Owl (Settings > Branding) */
.x-firm { flex: 0 0 100%; display: flex; align-items: center; min-width: 0; margin-top: .45rem; padding-top: .45rem; border-top: 1px solid rgba(127, 139, 171, .25); }
.x-brand .x-firm-logo { width: auto; height: auto; max-height: 38px; max-width: 100%; object-fit: contain; flex: 0 1 auto; }
.x-firm-name { font-size: .8rem; font-weight: 600; color: #3d4a60; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-firm-inline { flex: 0 1 auto; margin-top: 0; padding: 0 0 0 .6rem; border-top: 0; border-left: 1px solid rgba(255, 255, 255, .35); max-width: 14rem; }
.x-firm-inline .x-firm-name { color: inherit; }
.x-brand .x-firm-inline .x-firm-logo, .x-firm-inline .x-firm-logo { max-height: 30px; background: #fff; border-radius: 4px; padding: 2px 4px; }
body.sidebar-collapsed .x-firm { display: none; }
.auth-firm { margin-top: .75rem; display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.auth-firm-with { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #7b879b; }
.auth-firm-logo { max-height: 56px; max-width: 220px; object-fit: contain; }
.auth-firm-name { font-weight: 600; color: #0f1d33; }
.cobrand-preview { background: #f8f9fb; }
.cobrand { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; }
.cobrand-product { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; }
.cobrand-mark { width: 44px; height: 44px; }
.cobrand-x { width: 40%; border-top: 1px solid #d5dbe5; }
.cobrand-firm { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.cobrand-logo { max-height: 56px; max-width: 220px; object-fit: contain; }
.cobrand-name { font-weight: 600; }
.cobrand-tagline { font-size: .8rem; color: #5d6a80; }
.wf-flow { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; }
.wf-node { border: 1px solid #e2e6ec; border-radius: .5rem; padding: .6rem .75rem; background: #fbfcfd; }
.wf-status { margin-bottom: .35rem; }
.wf-edge { padding-left: .25rem; margin-top: .15rem; }
/* Audit Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-head { font-size: .75rem; font-weight: 600; text-transform: uppercase; color: #7b879b; padding: .25rem .4rem; }
.cal-day { min-height: 7rem; border: 1px solid #e7ebf0; border-radius: .35rem; padding: .25rem .3rem; background: #fff; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-out { background: #f7f8fa; }
.cal-out .cal-num { color: #b0b8c5; }
.cal-today { border-color: #2f7fd1; box-shadow: inset 0 0 0 1px #2f7fd1; }
.cal-num { font-size: .8rem; font-weight: 600; color: #3d4a60; }
.cal-ev { display: block; font-size: .72rem; line-height: 1.25; padding: 1px 4px; border-radius: 3px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; }
.cal-primary { background: #e8f0fb; color: #12335e; border-color: #2f7fd1; }
.cal-warning { background: #fff6e0; color: #6b4e00; border-color: #e0a800; }
.cal-danger { background: #fdecec; color: #7a1c1c; border-color: #d9534f; }
.cal-success { background: #e6f5ec; color: #1d5e36; border-color: #2e9e5b; }
.cal-late { font-weight: 700; }
.cal-agenda-day { border-bottom: 1px solid #eef1f5; padding: .4rem 0; }
.cal-month { min-width: 9rem; text-align: center; }
.role-matrix td:first-child { min-width: 16rem; }
.role-matrix th:not(:first-child) { min-width: 7rem; }
body.sidebar-collapsed .x-brand { flex-wrap: nowrap; }
@media (max-width: 991.98px) { .x-brand .instance-badge, .x-brand .x-firm { display: none; } .x-top, .x-brand { flex-wrap: nowrap; } html.theme-light body { overflow-x: clip; } }
/* on a phone the Settings pages are a row below the header, not a column inside it */
@media (max-width: 575.98px) {
  html.theme-light .x-shell > .settings-pane { display: flex; flex: 0 0 100%; order: 6; overflow-x: auto; padding: 0 .75rem .35rem; border-bottom: 0; }
  html.theme-light .x-shell:has(> .settings-pane) .app-main { order: 7; }
  .x-shell > .settings-pane .settings-pane-title, .x-shell > .settings-pane .settings-section-label { display: none; }
  .x-shell > .settings-pane .nav { flex-direction: row !important; flex-wrap: nowrap; }
  .x-shell > .settings-pane .nav-link { white-space: nowrap; }
}

/* the firm's own logo stands alone: no Auditor Owl mark or name beside it */
.x-brand > .x-firm:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.navbar-brand > .x-firm-inline:first-child { margin-left: 0 !important; padding-left: 0; border-left: 0; }

/* AI buttons: GRC Owl's exact soft violet tint, so primary workflow steps stay the only solid button beside them */
.btn-ai {
  --bs-btn-color: #5b3a96; --bs-btn-bg: #efe9f8; --bs-btn-border-color: #dccff2;
  --bs-btn-hover-color: #48298f; --bs-btn-hover-bg: #e4d9f5; --bs-btn-hover-border-color: #cdbbec;
  --bs-btn-active-color: #48298f; --bs-btn-active-bg: #d9caf1; --bs-btn-active-border-color: #cdbbec;
  --bs-btn-disabled-color: #5b3a96; --bs-btn-disabled-bg: #efe9f8; --bs-btn-disabled-border-color: #dccff2;
  --bs-btn-focus-shadow-rgb: 105, 65, 198;
}
.text-ai { color: #5b3a96; }
.border-ai { border-color: #dccff2 !important; }
.owl-widget[data-ai="1"] .owl-fab { border-color: #5b3a96; background: #efe9f8; }
.owl-widget[data-ai="1"] .owl-head { background: #48298f; }
.owl-widget[data-ai="1"] .owl-send { background: #5b3a96; }
.owl-widget[data-ai="1"] .owl-send:hover { background: #48298f; }

/* Ask Owl floating assistant widget (GRC Owl parity) */
.owl-widget { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.owl-fab { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #2f7fd1; background: #fff; box-shadow: 0 6px 20px rgba(15, 29, 51, .22); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.owl-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 29, 51, .28); }
.owl-panel { width: min(390px, calc(100vw - 2rem)); max-height: min(560px, calc(100vh - 6rem)); background: #fff; border: 1px solid #d5dbe5; border-radius: .85rem; box-shadow: 0 14px 36px rgba(15, 29, 51, .22); display: flex; flex-direction: column; overflow: hidden; }
.owl-panel[hidden] { display: none; }
.owl-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; background: #12335e; color: #fff; }
.owl-head-img { border-radius: 50%; background: #fff; padding: 2px; flex: 0 0 auto; }
.owl-head-text { flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.owl-head-text strong { display: block; font-size: .95rem; }
.owl-head-text small { display: block; font-size: .72rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owl-icon-btn { background: transparent; border: 0; color: #fff; opacity: .82; padding: .25rem .35rem; border-radius: .35rem; cursor: pointer; }
.owl-icon-btn:hover { opacity: 1; background: rgba(255, 255, 255, .14); }
.owl-log { flex: 1 1 auto; overflow-y: auto; padding: .85rem; display: flex; flex-direction: column; gap: .65rem; background: #f8fafc; font-size: .875rem; }
.owl-msg { max-width: 92%; padding: .55rem .75rem; border-radius: .65rem; white-space: pre-wrap; word-break: break-word; }
.owl-msg-bot { align-self: flex-start; background: #fff; border: 1px solid #e2e8f0; color: #1e293b; }
.owl-msg-user { align-self: flex-end; background: #1f4e8c; color: #fff; }
.owl-items { display: flex; flex-direction: column; gap: .3rem; margin-top: .45rem; }
.owl-item { display: block; padding: .4rem .55rem; border: 1px solid #e2e8f0; border-radius: .45rem; background: #f8fafc; text-decoration: none; color: #0f1d33; font-size: .8rem; }
.owl-item:hover { background: #e8f0fb; border-color: #2f7fd1; }
.owl-item-sub { display: block; color: #64748b; font-size: .72rem; }
.owl-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.owl-chip { border: 1px solid #cbd5e1; background: #fff; color: #12335e; border-radius: 999px; padding: .2rem .6rem; font-size: .75rem; cursor: pointer; }
.owl-chip:hover { background: #e8f0fb; border-color: #2f7fd1; }
.owl-form { display: flex; gap: .4rem; padding: .6rem; border-top: 1px solid #e2e8f0; background: #fff; }
.owl-input { flex: 1 1 auto; border: 1px solid #cbd5e1; border-radius: .5rem; padding: .45rem .65rem; font-size: .875rem; }
.owl-input:focus { outline: 2px solid #2f7fd1; outline-offset: -1px; }
.owl-send { border: 0; border-radius: .5rem; background: #1f4e8c; color: #fff; padding: .45rem .75rem; cursor: pointer; }
.owl-send:hover { background: #12335e; }
.owl-send:disabled { opacity: .6; cursor: default; }

/* ===== Phase 2 QA fixes: single-caret <select> hygiene (QA-003) & 1280px Settings layout (QA-004) ===== */
select.form-select:not([multiple]):not([size]) {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
}
select.form-select::-ms-expand { display: none; }

@media (min-width: 992px) {
  html.theme-light .x-shell { flex-wrap: nowrap; }
  html.theme-light .x-col, .app-shell > .app-main { min-width: 0; flex: 1 1 auto; }
}
@media (min-width: 992px) and (max-width: 1399.98px) {
  .settings-pane { flex: 0 0 196px; width: 196px; }
  html.theme-light .x-side { width: 224px; flex: 0 0 224px; }
}
