/* AUH BMS – application styles on top of Bootstrap 5 */
:root {
    --bms-sidebar-width: 250px;
}

body {
    min-height: 100vh;
}

.bms-sidebar {
    width: var(--bms-sidebar-width);
    min-height: 100vh;
}

.bms-sidebar .nav-link {
    color: var(--bs-body-color);
    border-radius: .375rem;
    padding: .45rem .75rem;
}

.bms-sidebar .nav-link:hover {
    background-color: var(--bs-tertiary-bg);
}

.bms-sidebar .nav-link.active {
    background-color: var(--bs-primary);
    color: #fff;
}

.bms-sidebar .nav-section {
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    padding: 1rem .75rem .25rem;
}

.bms-main {
    min-width: 0;
}

.bms-stat .display-6 {
    font-weight: 600;
}

.table th a {
    color: inherit;
    text-decoration: none;
}

.table th a:hover {
    text-decoration: underline;
}

.bms-json {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .8rem;
    max-height: 24rem;
    overflow: auto;
}

[data-ajax-table].is-loading {
    opacity: .5;
    pointer-events: none;
}

.bms-permission-grid .form-check {
    min-width: 260px;
}

.bms-ua {
    max-width: 20rem;
}

.bms-prewrap {
    white-space: pre-wrap;
    word-break: break-word;
}

.bms-email-frame {
    width: 100%;
    min-height: 28rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    background: #fff;
}

.bms-pipeline {
    overflow-x: auto;
}

.bms-pipeline-column {
    min-width: 260px;
}

/* Business calendar form */
.bms-day-label { width: 6rem; flex-shrink: 0; }

/* Signature pad */
.bms-signature { user-select: none; -webkit-user-select: none; }
.bms-signature canvas { width: 100%; max-width: 600px; height: auto; aspect-ratio: 3 / 1; border: 1px dashed var(--bs-border-color); border-radius: .375rem; background: #fff; touch-action: none; display: block; }

/* Finance */
.bms-w-8rem { width: 8rem; }
@media print {
    .bms-print { max-width: 100%; }
}

/* SaaS: public invoice payment page and branding */
.bms-narrow { max-width: 860px; }
.bms-brand-logo { max-height: 32px; max-width: 160px; object-fit: contain; }
.bms-plan-card.is-current { border-color: var(--bs-primary); border-width: 2px; }

/* Saved views and dashboards (Phase 12) */
.bms-views-menu { min-width: 18rem; }
.bms-chart { width: 100%; height: auto; display: block; }
.bms-chart .bar { fill: var(--bs-primary); }
.bms-chart g:hover .bar { fill: var(--bs-primary-text-emphasis); }
.bms-chart .grid { stroke: var(--bs-border-color); stroke-width: 1; }
.bms-chart .axis { fill: var(--bs-secondary-color); font-size: 12px; }
.bms-chart .value { fill: var(--bs-body-color); font-size: 12px; }
.bms-kpi .bms-kpi-value { font-size: clamp(1rem, 2.5vw, 1.35rem); font-weight: 600; line-height: 1.2; word-break: break-word; }
@media print {
    .bms-sidebar, header.navbar, .d-print-none, .offcanvas { display: none !important; }
}

/* Price book and offer rate inputs */
.bms-input-price { max-width: 7rem; }
.bms-input-level { min-width: 6.5rem; }

/* Staff avatars: profile photo or initials (inline styles are blocked by the CSP) */
.bms-avatar { width: 32px; height: 32px; font-size: 13px; object-fit: cover; color: #fff; line-height: 1; }
.bms-avatar-22 { width: 22px; height: 22px; font-size: 10px; }
.bms-avatar-28 { width: 28px; height: 28px; font-size: 11px; }
.bms-avatar-64 { width: 64px; height: 64px; font-size: 24px; }
.bms-avatar-72 { width: 72px; height: 72px; font-size: 28px; }
.bms-photo-frame { width: 160px; height: 160px; flex-shrink: 0; background-color: #fff; background-repeat: no-repeat; }
.bms-photo-controls { min-width: 12rem; }
.bms-skill-chips { max-height: 7.5rem; overflow-y: auto; }
.bms-avatar-c0 { background: #1f6f8b; } .bms-avatar-c1 { background: #7a3e9d; } .bms-avatar-c2 { background: #2e7d32; }
.bms-avatar-c3 { background: #b5532a; } .bms-avatar-c4 { background: #3949ab; } .bms-avatar-c5 { background: #00796b; }
.bms-avatar-c6 { background: #ad1457; } .bms-avatar-c7 { background: #5d4037; } .bms-avatar-c8 { background: #455a64; }
.bms-photo-input { max-width: 16rem; }

/* Site visits week board: seven equal day columns from tablet width */
@media (min-width: 768px) {
    .bms-week > .col { flex: 0 0 auto; width: 14.2857%; }
}
