/* =====================================================================
   CoreCent Support Desk — Dynamics 365 Business Central theme
   One component vocabulary for every page:
     app bar · navigation bar · page caption · action bar ·
     list page · card page (FastTabs + fields) · FactBox pane ·
     notification bar · dialog · Role Center cues
   ===================================================================== */

:root {
    --bc-font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;

    --bc-teal: #008272;
    --bc-teal-hover: #006b5e;
    --bc-teal-pressed: #005a50;
    --bc-teal-tint: #e6f3f1;
    --bc-teal-selected: #cde6e2;

    --bc-appbar: #002050;
    --bc-sidebar: #f3f3f3;
    --bc-text: #212121;
    --bc-text-2: #505050;
    --bc-muted: #707070;
    --bc-leader: #b0b0b0;
    --bc-border: #d6d6d6;
    --bc-border-light: #e8e8e8;
    --bc-field-bg: #f3f3f3;
    --bc-page-bg: #f8f8f8;
    --bc-surface: #ffffff;
    --bc-hover: #eaeaea;

    --bc-red: #a4262c;
    --bc-red-tint: #fde7e9;
    --bc-amber: #8a5a00;
    --bc-amber-tint: #fff4ce;
    --bc-green: #107c10;
    --bc-green-tint: #dff6dd;
    --bc-blue: #005a9e;
    --bc-blue-tint: #e5f1fb;

    --bc-radius: 2px;
    --bc-appbar-h: 40px;
    --bc-sidebar-w: 208px;
    --bc-shadow-pop: 0 6.4px 14.4px rgba(0, 0, 0, .13), 0 1.2px 3.6px rgba(0, 0, 0, .11);
    --bc-shadow-dialog: 0 25.6px 57.6px rgba(0, 0, 0, .22), 0 4.8px 14.4px rgba(0, 0, 0, .18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--bc-font);
    font-size: 13px;
    line-height: 1.35;
    color: var(--bc-text);
    background: var(--bc-page-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--bc-teal); text-decoration: none; }
a:hover { color: var(--bc-teal-hover); text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bc-teal); outline-offset: 1px; }

/* =====================================================================
   Shell: compact app bar + left sidebar + content
   ===================================================================== */
.bc-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.bc-appbar {
    height: var(--bc-appbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 6px 0 0;
    background: var(--bc-appbar);
    color: #fff;
    z-index: 300;
}

.bc-appbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 12px 0 10px;
    color: #fff;
}
.bc-appbar-brand:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .08); }

.bc-appbar-mark {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    background: var(--bc-teal);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -.02em;
}

.bc-appbar-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.bc-appbar-spacer { flex: 1; }

.bc-appbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #fff;
    border-radius: var(--bc-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.bc-appbar-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }

.bc-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bc-teal);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bc-account { position: relative; }
.bc-account-btn { width: auto; padding: 0 4px; }

.bc-account-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    width: 260px;
    background: var(--bc-surface);
    color: var(--bc-text);
    box-shadow: var(--bc-shadow-pop);
    border-radius: var(--bc-radius);
    display: none;
    z-index: 400;
}
.bc-account.open .bc-account-menu { display: block; }

.bc-account-head {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--bc-border-light);
}
.bc-account-head .bc-avatar { width: 36px; height: 36px; font-size: 13px; }
.bc-account-name { font-weight: 600; font-size: 13px; }
.bc-account-meta { font-size: 11px; color: var(--bc-muted); }

.bc-account-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--bc-text);
}
.bc-account-menu a:hover { background: var(--bc-hover); text-decoration: none; color: var(--bc-text); }

/* Body row: sidebar + content */
.bc-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.bc-sidebar {
    width: var(--bc-sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bc-sidebar);
    border-right: 1px solid var(--bc-border);
    overflow: auto;
    z-index: 200;
}

.bc-sidebar-company {
    padding: 10px 12px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--bc-text);
    border-bottom: 1px solid var(--bc-border-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-side-nav {
    display: flex;
    flex-direction: column;
    padding: 6px 0 12px;
}

.bc-side-item,
.bc-side-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 30px;
    padding: 5px 12px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: var(--bc-text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}
.bc-side-item:hover,
.bc-side-toggle:hover { background: #e6e6e6; color: var(--bc-text); text-decoration: none; }
.bc-side-item.active {
    background: var(--bc-teal-selected);
    border-left-color: var(--bc-teal);
    font-weight: 600;
    color: var(--bc-text);
}

.bc-side-icon {
    width: 16px;
    text-align: center;
    font-size: 12px;
    flex-shrink: 0;
    opacity: .85;
}

.bc-side-chevron {
    margin-left: auto;
    font-size: 9px;
    color: var(--bc-muted);
    transition: transform .12s;
}
.bc-side-group:not(.open) .bc-side-chevron { transform: rotate(-90deg); }

.bc-side-group.active > .bc-side-toggle {
    font-weight: 600;
    border-left-color: var(--bc-teal);
}

.bc-side-children {
    display: none;
    flex-direction: column;
    padding: 0 0 4px;
}
.bc-side-group.open .bc-side-children { display: flex; }

.bc-side-children a {
    display: block;
    padding: 4px 12px 4px 36px;
    color: var(--bc-text-2);
    font-size: 12px;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bc-side-children a:hover { background: #e6e6e6; color: var(--bc-text); text-decoration: none; }
.bc-side-children a.active {
    background: var(--bc-teal-selected);
    border-left-color: var(--bc-teal);
    color: var(--bc-text);
    font-weight: 600;
}

.bc-content { flex: 1; overflow: auto; min-height: 0; background: var(--bc-surface); }

/* =====================================================================
   Page: caption + action bar
   ===================================================================== */
.bc-page {
    max-width: 1680px;
    margin: 0 auto;
    min-height: 100%;
    background: var(--bc-surface);
    display: flex;
    flex-direction: column;
}

.bc-page-head { padding: 6px 14px 0; }

.bc-caption-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
}

.bc-back {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bc-teal-tint);
    color: var(--bc-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.bc-back:hover { background: var(--bc-teal-selected); color: var(--bc-text); text-decoration: none; }

.bc-page-type { font-size: 12px; color: var(--bc-text-2); }

.bc-caption-tools { margin-left: auto; display: flex; gap: 1px; }

.bc-tool {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--bc-radius);
    color: var(--bc-text-2);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bc-tool:hover { background: var(--bc-hover); color: var(--bc-teal); text-decoration: none; }
.bc-tool[disabled] { opacity: .4; cursor: default; background: transparent; color: var(--bc-text-2); }

.bc-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--bc-text);
    margin: 2px 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bc-title-sep { color: var(--bc-muted); padding: 0 4px; font-weight: 400; }
.bc-title.list { font-size: 16px; font-weight: 600; margin: 0; }

/* Action bar: tabs row + actions row */
.bc-actiontabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 14px;
    border-bottom: 1px solid var(--bc-border-light);
}

.bc-actiontab {
    height: 28px;
    padding: 0 8px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--bc-text);
    font-size: 12px;
    cursor: pointer;
}
.bc-actiontab:hover { color: var(--bc-teal); }
.bc-actiontab.active { color: var(--bc-teal); border-bottom-color: var(--bc-teal); }
.bc-actiontab-sep { width: 1px; height: 16px; background: var(--bc-border); margin: 0 4px; }

.bc-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1px;
    padding: 2px 10px;
    border-bottom: 1px solid var(--bc-border-light);
    min-height: 34px;
}
.bc-action-group { display: none; align-items: center; flex-wrap: wrap; gap: 2px; }
.bc-action-group.active { display: flex; }
.bc-actions.show-all .bc-action-group { display: flex; }
.bc-actions.show-all .bc-action-group + .bc-action-group::before {
    content: "";
    width: 1px;
    height: 20px;
    background: var(--bc-border);
    margin: 0 6px;
}

.bc-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 7px;
    border: none;
    background: transparent;
    border-radius: var(--bc-radius);
    color: var(--bc-text);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.bc-action:hover { background: var(--bc-hover); color: var(--bc-text); text-decoration: none; }
.bc-action[disabled] { opacity: .45; cursor: default; background: transparent; }
.bc-action-icon { color: var(--bc-teal); font-size: 13px; width: 14px; text-align: center; }
.bc-action.promoted { font-weight: 600; }
.bc-actions-spacer { flex: 1; }

.bc-icon-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--bc-radius);
    color: var(--bc-text-2);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bc-icon-btn:hover, .bc-icon-btn.active { background: var(--bc-hover); color: var(--bc-teal); }
.bc-icon-btn[disabled] { opacity: .4; cursor: default; background: transparent; }

/* Notification bar */
.bc-notify {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 14px 0;
    padding: 6px 10px;
    border-radius: var(--bc-radius);
    font-size: 12px;
    background: var(--bc-blue-tint);
    color: var(--bc-text);
}
.bc-notify-icon { font-weight: 700; flex-shrink: 0; width: 18px; text-align: center; color: var(--bc-blue); }
.bc-notify-body { flex: 1; }
.bc-notify-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.bc-notify-actions button,
.bc-notify-actions a {
    border: none;
    background: none;
    color: var(--bc-teal);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.bc-notify-actions button:hover { text-decoration: underline; }
.bc-notify-close {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--bc-text-2);
    font-size: 16px;
    line-height: 1;
}
.bc-notify.success { background: var(--bc-green-tint); }
.bc-notify.success .bc-notify-icon { color: var(--bc-green); }
.bc-notify.error { background: var(--bc-red-tint); }
.bc-notify.error .bc-notify-icon { color: var(--bc-red); }
.bc-notify.warning { background: var(--bc-amber-tint); }
.bc-notify.warning .bc-notify-icon { color: var(--bc-amber); }

/* =====================================================================
   Card page: body + FactBox pane
   ===================================================================== */
.bc-card-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 248px;
    flex: 1;
    min-height: 0;
}
.bc-card-layout.no-factbox { grid-template-columns: minmax(0, 1fr); }

.bc-card-body { padding: 4px 14px 20px; min-width: 0; }

/* FastTab */
.bc-fasttab { border-bottom: 1px solid var(--bc-border-light); }

.bc-fasttab-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px;
    cursor: pointer;
    user-select: none;
}

.bc-fasttab-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--bc-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bc-fasttab-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--bc-text-2);
    border-bottom: 1.5px solid var(--bc-text-2);
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform .12s;
}
.bc-fasttab.collapsed .bc-fasttab-title::before { transform: rotate(-45deg); }

.bc-fasttab-summary {
    flex: 1;
    font-size: 11px;
    color: var(--bc-muted);
    display: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bc-fasttab.collapsed .bc-fasttab-summary { display: block; }

.bc-fasttab-more {
    margin-left: auto;
    border: none;
    background: none;
    color: var(--bc-text-2);
    font-size: 11px;
    cursor: pointer;
}
.bc-fasttab-more:hover { color: var(--bc-teal); text-decoration: underline; }

.bc-fasttab-content { padding: 0 0 10px; }
.bc-fasttab.collapsed .bc-fasttab-content { display: none; }

/* Field grid with dotted leaders */
.bc-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
}
.bc-fields.single { grid-template-columns: minmax(0, 1fr); }
.bc-fields-col { min-width: 0; }

.bc-group-caption {
    font-size: 12px;
    font-weight: 600;
    margin: 8px 0 4px;
}

.bc-field {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: 8px;
    min-height: 26px;
    padding: 1px 0;
}
.bc-field.wide { grid-template-columns: minmax(100px, .5fr) minmax(0, 1.5fr); }

.bc-field-label {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    color: var(--bc-text-2);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}
.bc-field-label::after {
    content: "";
    flex: 1;
    min-width: 8px;
    border-bottom: 1px dotted var(--bc-leader);
    transform: translateY(3px);
}
.bc-field-label.required > span::after { content: " *"; color: var(--bc-red); }

.bc-field-value {
    min-height: 24px;
    padding: 2px 6px;
    background: var(--bc-field-bg);
    border-radius: var(--bc-radius);
    color: var(--bc-text);
    font-size: 12px;
    overflow-wrap: anywhere;
}
.bc-field-value.numeric { text-align: right; }
.bc-field-value.multiline { white-space: pre-wrap; line-height: 1.4; min-height: 48px; }
.bc-field-value.plain { background: transparent; padding-left: 0; }

.bc-more-field { display: none; }
.bc-fasttab.show-more .bc-more-field { display: grid; }

/* Editable controls (card pages and dialogs) */
.bc-input {
    display: block;
    width: 100%;
    min-height: 24px;
    padding: 2px 6px;
    border: 1px solid transparent;
    border-bottom-color: var(--bc-border);
    border-radius: var(--bc-radius);
    background: var(--bc-field-bg);
    color: var(--bc-text);
    font-size: 12px;
    outline: none;
}
.bc-input:hover { border-bottom-color: var(--bc-text-2); }
.bc-input:focus { background: var(--bc-surface); border: 1px solid var(--bc-teal); }
.bc-input[readonly] { color: var(--bc-text-2); cursor: default; }
textarea.bc-input { resize: vertical; min-height: 72px; line-height: 1.4; }
select.bc-input { cursor: pointer; }
.input-validation-error.bc-input { border-color: var(--bc-red); background: #fff; }

.bc-validation { display: block; font-size: 11px; color: var(--bc-red); margin-top: 1px; }
.bc-validation:empty { display: none; }
.validation-summary-valid { display: none; }

.bc-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--bc-text-2);
    cursor: pointer;
}
.bc-check input { width: 14px; height: 14px; accent-color: var(--bc-teal); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 68px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius);
    background: var(--bc-surface);
    color: var(--bc-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: var(--bc-hover); text-decoration: none; color: var(--bc-text); }
.btn-primary { background: var(--bc-teal); border-color: var(--bc-teal); color: #fff; }
.btn-primary:hover { background: var(--bc-teal-hover); border-color: var(--bc-teal-hover); color: #fff; }
.btn-primary:active { background: var(--bc-teal-pressed); }
.btn-danger { background: var(--bc-red); border-color: var(--bc-red); color: #fff; }
.btn-danger:hover { background: #8a1f25; color: #fff; }
.btn-block { width: 100%; }

/* FactBox pane */
.bc-factbox-pane {
    border-left: 1px solid var(--bc-border-light);
    background: var(--bc-surface);
    padding: 4px 0 16px;
    min-width: 0;
}
.bc-factbox { border-bottom: 1px solid var(--bc-border-light); }
.bc-factbox-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.bc-factbox-head::after {
    content: "";
    margin-left: auto;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid var(--bc-text-2);
    border-bottom: 1.5px solid var(--bc-text-2);
    transform: rotate(45deg);
}
.bc-factbox.collapsed .bc-factbox-head::after { transform: rotate(-45deg); }
.bc-factbox-content { padding: 0 12px 8px; }
.bc-factbox.collapsed .bc-factbox-content { display: none; }

.bc-fact {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 2px 0;
    font-size: 11px;
}
.bc-fact-label {
    display: flex;
    flex: 1;
    gap: 6px;
    color: var(--bc-text-2);
    white-space: nowrap;
    min-width: 0;
}
.bc-fact-label::after {
    content: "";
    flex: 1;
    min-width: 10px;
    border-bottom: 1px dotted var(--bc-leader);
    transform: translateY(-4px);
}
.bc-fact-value { text-align: right; color: var(--bc-text); max-width: 60%; overflow-wrap: anywhere; }
.bc-fact-value.link { color: var(--bc-teal); font-weight: 600; }
.bc-fact-value.bad { color: var(--bc-red); font-weight: 600; }

.bc-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}

/* =====================================================================
   Communication log (FastTab)
   ===================================================================== */
.bc-log { display: flex; flex-direction: column; }

.bc-log-entry {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--bc-border-light);
}
.bc-log-entry:first-child { border-top: none; }

.bc-log-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bc-blue-tint);
    color: var(--bc-blue);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bc-log-entry.client .bc-log-avatar { background: var(--bc-green-tint); color: var(--bc-green); }
.bc-log-entry.internal .bc-log-avatar { background: #ececec; color: var(--bc-text-2); }

.bc-log-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--bc-muted);
    margin-bottom: 2px;
}
.bc-log-author { font-weight: 600; color: var(--bc-text); }
.bc-log-body { white-space: pre-wrap; line-height: 1.4; font-size: 12px; }
.bc-log-entry.internal .bc-log-body {
    background: #fafafa;
    border-left: 2px solid #a0a0a0;
    padding: 4px 8px;
}

.bc-tag {
    display: inline-block;
    padding: 0 5px;
    border-radius: var(--bc-radius);
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    background: #ececec;
    color: var(--bc-text-2);
}
.bc-tag.internal { background: #505050; color: #fff; }
.bc-tag.client { background: var(--bc-green-tint); color: var(--bc-green); }

.bc-composer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--bc-border-light);
}
.bc-composer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.bc-empty-text { color: var(--bc-muted); padding: 8px 0; }

/* =====================================================================
   Status / priority indicators
   ===================================================================== */
.badge {
    display: inline-block;
    padding: 0 6px;
    border-radius: var(--bc-radius);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
    background: #ececec;
    color: var(--bc-text-2);
}
.badge-new { background: var(--bc-blue-tint); color: var(--bc-blue); }
.badge-assigned { background: #ececec; color: #3b3a39; }
.badge-inprogress { background: var(--bc-amber-tint); color: var(--bc-amber); }
.badge-pendingclient { background: var(--bc-amber-tint); color: var(--bc-amber); }
.badge-resolvedawaitingtesting { background: var(--bc-teal-tint); color: var(--bc-teal-pressed); }
.badge-clienttesting { background: var(--bc-teal-tint); color: var(--bc-teal-pressed); }
.badge-reopened { background: var(--bc-red-tint); color: var(--bc-red); }
.badge-confirmed { background: var(--bc-green-tint); color: var(--bc-green); }
.badge-closed { background: #ececec; color: var(--bc-muted); }
.badge-onhold { background: #e1e1e1; color: #3b3a39; }
.badge-escalated { background: var(--bc-red-tint); color: var(--bc-red); }

.badge-low { background: #ececec; color: var(--bc-muted); }
.badge-normal { background: var(--bc-blue-tint); color: var(--bc-blue); }
.badge-high { background: var(--bc-amber-tint); color: var(--bc-amber); }
.badge-critical { background: var(--bc-red-tint); color: var(--bc-red); }

.badge-active { background: var(--bc-green-tint); color: var(--bc-green); }
.badge-inactive { background: #ececec; color: var(--bc-muted); }

.bc-overdue { color: var(--bc-red); font-weight: 700; }

/* =====================================================================
   List page
   ===================================================================== */
.bc-filter-pane {
    display: none;
    padding: 8px 14px 10px;
    background: #fafafa;
    border-bottom: 1px solid var(--bc-border-light);
}
.bc-filter-pane.open { display: block; }
.bc-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px 12px;
    align-items: end;
}
.bc-filter-label { display: block; font-size: 11px; color: var(--bc-text-2); margin-bottom: 2px; }
.bc-filter-buttons { display: flex; gap: 6px; }

.bc-list-wrap { flex: 1; overflow: auto; padding: 0 8px; }

.bc-list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}
.bc-list thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 6px 8px 5px;
    background: var(--bc-surface);
    border-bottom: 1px solid var(--bc-border);
    color: var(--bc-text-2);
    font-size: 11px;
    font-weight: 400;
    text-align: left;
    white-space: nowrap;
    vertical-align: bottom;
}
.bc-list th.num, .bc-list td.num { text-align: right; }
.bc-list tbody td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--bc-border-light);
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.bc-list tbody tr { background: var(--bc-surface); }
.bc-list tbody tr[data-href] { cursor: pointer; }
.bc-list tbody tr:hover { background: #f5f5f5; }
.bc-list tbody tr.selected { background: var(--bc-teal-selected); }
.bc-list tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--bc-teal); }
.bc-list .bc-link { color: var(--bc-teal); text-decoration: underline; text-underline-offset: 2px; }
.bc-list .muted { color: var(--bc-muted); }
.bc-list .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 11px; }
.bc-list-empty td { text-align: center; padding: 28px 8px !important; color: var(--bc-muted); }

/* Row actions — always visible, never clipped by ellipsis */
.bc-list th.bc-col-actions,
.bc-list td.bc-col-actions {
    position: sticky;
    right: 0;
    z-index: 3;
    width: 1%;
    min-width: 150px;
    max-width: none;
    overflow: visible;
    white-space: nowrap;
    text-align: right;
    background: var(--bc-surface);
    box-shadow: -6px 0 8px -6px rgba(0, 0, 0, .12);
}
.bc-list thead th.bc-col-actions { z-index: 4; }
.bc-list tbody tr:hover td.bc-col-actions { background: #f5f5f5; }
.bc-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex-wrap: nowrap;
}
.bc-row-action {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 8px;
    border: none;
    background: transparent;
    color: var(--bc-teal);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--bc-radius);
    white-space: nowrap;
}
.bc-row-action:hover { background: var(--bc-teal-selected); color: var(--bc-teal); text-decoration: underline; }
.bc-row-action.danger { color: #a4262c; }
.bc-row-action.danger:hover { background: #fde7e9; color: #a4262c; }
.bc-row-actions .sep {
    width: 1px;
    height: 12px;
    background: var(--bc-border);
    margin: 0 2px;
}

.bc-list-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 14px;
    border-top: 1px solid var(--bc-border-light);
    color: var(--bc-muted);
    font-size: 11px;
}
.bc-pager { display: flex; gap: 2px; }
.bc-pager a, .bc-pager span {
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bc-radius);
    color: var(--bc-text);
}
.bc-pager a:hover { background: var(--bc-hover); text-decoration: none; }
.bc-pager .current { background: var(--bc-teal); color: #fff; font-weight: 600; }

/* =====================================================================
   Role Center (dashboard)
   ===================================================================== */
.bc-rc { max-width: 1680px; margin: 0 auto; padding: 12px 16px 24px; }

.bc-headline {
    background: var(--bc-surface);
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: var(--bc-radius);
    border: 1px solid var(--bc-border-light);
}
.bc-headline-greeting { font-size: 11px; color: var(--bc-text-2); margin-bottom: 2px; }
.bc-headline-text { font-size: 18px; font-weight: 600; line-height: 1.3; }
.bc-headline-text strong { font-weight: 700; color: var(--bc-teal); }

.bc-part {
    background: var(--bc-surface);
    border-radius: var(--bc-radius);
    padding: 10px 12px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--bc-border-light);
}
.bc-part-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.bc-part-title a { margin-left: auto; font-size: 11px; font-weight: 400; }

.bc-parts-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bc-parts-2 .bc-part { margin-bottom: 0; }
.bc-parts-2 + .bc-part, .bc-parts-2 + .bc-parts-2 { margin-top: 12px; }

.bc-cue-groups { display: flex; flex-wrap: wrap; gap: 16px; }
.bc-cue-group-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bc-text-2);
    margin-bottom: 6px;
}
.bc-cues { display: flex; flex-wrap: wrap; gap: 6px; }

.bc-cue {
    width: 100px;
    height: 84px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--bc-teal);
    color: #fff;
    border-radius: var(--bc-radius);
    transition: background .12s;
}
.bc-cue:hover { background: var(--bc-teal-hover); color: #fff; text-decoration: none; }
.bc-cue-label { font-size: 11px; line-height: 1.2; }
.bc-cue-value { font-size: 26px; font-weight: 300; line-height: 1; text-align: right; }
.bc-cue.unfavorable { background: var(--bc-red); }
.bc-cue.unfavorable:hover { background: #8a1f25; }
.bc-cue.ambiguous { background: #c25400; }
.bc-cue.ambiguous:hover { background: #a14600; }

.bc-chart-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
}
.bc-chart-label { color: var(--bc-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-chart-track { height: 10px; background: #f0f0f0; border-radius: 1px; overflow: hidden; }
.bc-chart-bar { height: 100%; background: var(--bc-teal); }
.bc-chart-bar.red { background: var(--bc-red); }
.bc-chart-bar.amber { background: #c25400; }
.bc-chart-bar.blue { background: var(--bc-blue); }
.bc-chart-bar.gray { background: #8a8886; }
.bc-chart-value { text-align: right; font-weight: 600; }

/* =====================================================================
   Dialog
   ===================================================================== */
.bc-dialog {
    border: none;
    padding: 0;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    margin: auto;
    border-radius: var(--bc-radius);
    box-shadow: var(--bc-shadow-dialog);
    color: var(--bc-text);
    background: var(--bc-surface);
}
.bc-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.bc-dialog-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 6px;
}
.bc-dialog-title { font-size: 15px; font-weight: 600; flex: 1; }
.bc-dialog-close {
    border: none;
    background: none;
    font-size: 15px;
    cursor: pointer;
    color: var(--bc-text-2);
    width: 28px;
    height: 28px;
}
.bc-dialog-close:hover { background: var(--bc-hover); }
.bc-dialog-body { padding: 6px 16px 10px; }
.bc-dialog-body p { color: var(--bc-text-2); margin-bottom: 8px; font-size: 12px; }
.bc-dialog-body .bc-field { grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); }
.bc-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 8px 16px 14px;
}

/* =====================================================================
   Sign-in / standalone pages
   ===================================================================== */
.bc-signin-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background: #f2f2f2;
}
.bc-signin-box {
    width: 100%;
    max-width: 440px;
    padding: 44px;
    background: var(--bc-surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.bc-signin-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.bc-signin-mark {
    width: 32px;
    height: 32px;
    background: var(--bc-appbar);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bc-signin-product { font-size: 15px; font-weight: 600; color: var(--bc-text-2); }
.bc-signin-title { font-size: 24px; font-weight: 600; margin-bottom: 16px; }
.bc-signin-field { margin-bottom: 16px; }
.bc-signin-field label { display: block; font-size: 13px; color: var(--bc-text-2); margin-bottom: 4px; }
.bc-signin-input {
    width: 100%;
    height: 36px;
    padding: 6px 2px;
    border: none;
    border-bottom: 1px solid #666;
    background: transparent;
    font-size: 15px;
    outline: none;
}
.bc-signin-input:focus { border-bottom: 2px solid var(--bc-teal); }
.bc-signin-foot { display: flex; justify-content: flex-end; margin-top: 24px; }
.bc-signin-legal { font-size: 12px; color: var(--bc-muted); }
.bc-signin-box .bc-notify { margin: 0 0 16px; }

.bc-message-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bc-page-bg);
}
.bc-message-box {
    max-width: 520px;
    width: 100%;
    background: var(--bc-surface);
    padding: 32px;
    box-shadow: var(--bc-shadow-pop);
}
.bc-message-box h1 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.bc-message-box p { color: var(--bc-text-2); margin-bottom: 20px; }

/* "Tell me" search dialog */
.bc-tellme-list { list-style: none; max-height: 320px; overflow: auto; margin-top: 8px; }
.bc-tellme-list a {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    color: var(--bc-text);
    border-radius: var(--bc-radius);
}
.bc-tellme-list a:hover, .bc-tellme-list a.active { background: var(--bc-teal-tint); text-decoration: none; }
.bc-tellme-list small { color: var(--bc-muted); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1200px) {
    .bc-card-layout { grid-template-columns: minmax(0, 1fr); }
    .bc-factbox-pane { border-left: none; border-top: 1px solid var(--bc-border-light); }
}

@media (max-width: 900px) {
    .bc-fields { grid-template-columns: minmax(0, 1fr); }
    .bc-parts-2 { grid-template-columns: minmax(0, 1fr); }
    .bc-sidebar { width: 168px; }
    .bc-appbar-name { font-size: 13px; }
    .bc-page-head, .bc-card-body { padding-left: 10px; padding-right: 10px; }
    .bc-actiontabs, .bc-filter-pane, .bc-list-foot { padding-left: 10px; padding-right: 10px; }
    .bc-notify { margin-left: 10px; margin-right: 10px; }
    .bc-rc { padding: 10px; }
    .bc-title { font-size: 16px; }
}

@media (max-width: 720px) {
    .bc-sidebar { display: none; }
}

@media print {
    .bc-appbar, .bc-sidebar, .bc-actiontabs, .bc-actions, .bc-caption-tools, .bc-composer { display: none !important; }
    .bc-shell, .bc-body { height: auto; overflow: visible; display: block; }
    .bc-content { overflow: visible; }
    .bc-card-layout { grid-template-columns: minmax(0, 1fr); }
}
