:root {
    --blm-dark: #073b44;
    --blm-deep: #0d6f7d;
    --blm-primary: #0d6f7d;
    --blm-primary-dark: #073b44;
    --blm-ink: #17252a;
    --blm-accent: #0ea5e9;
    --blm-accent-dark: #0369a1;
    --blm-cyan: #12aeb8;
    --blm-bg: #f4f8f9;
    --blm-border: #dce7ea;
    --sidebar-width: 260px;
    --sidebar-collapsed: 78px;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #17252a;
    background: var(--blm-bg);
}

body.portal-cliente {
    --cliente-cor-principal: var(--blm-deep);
    --cliente-cor-botoes: var(--blm-accent-dark);
    --cliente-cor-destaque: var(--blm-accent);
    --cliente-texto-principal: #fff;
    --cliente-texto-botoes: #fff;
    --cliente-texto-destaque: #17252a;
    --cliente-logo-fundo: var(--cliente-cor-principal);
}

body.portal-cliente .sidebar {
    background: var(--cliente-cor-principal);
    color: var(--cliente-texto-principal);
}

body.portal-cliente .sidebar-brand {
    background: var(--cliente-logo-fundo);
    color: #fff;
    border-bottom-color: color-mix(in srgb, var(--cliente-cor-destaque), #fff 20%);
}

body.portal-cliente .sidebar-brand .brand-logo {
    max-height: 74px;
    object-fit: contain;
    border-radius: 8px;
}

body.portal-cliente .sidebar-nav .nav-link {
    color: color-mix(in srgb, var(--cliente-texto-principal), transparent 12%);
}

body.portal-cliente .sidebar-nav .nav-link i {
    color: color-mix(in srgb, var(--cliente-cor-destaque), #fff 18%);
}

body.portal-cliente .sidebar-nav .nav-link.active,
body.portal-cliente .sidebar-nav .nav-link:hover {
    background: var(--cliente-cor-destaque);
    color: var(--cliente-texto-destaque);
}

body.portal-cliente .sidebar-nav .nav-link.active {
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--cliente-cor-destaque), #000 18%);
}

body.portal-cliente .sidebar-nav .nav-link.active i,
body.portal-cliente .sidebar-nav .nav-link:hover i {
    color: var(--cliente-texto-destaque);
}

body.portal-cliente .sidebar-nav .nav-link small {
    background: var(--cliente-cor-destaque);
    color: var(--cliente-texto-destaque);
}

body.portal-cliente .topbar {
    border-bottom-color: color-mix(in srgb, var(--cliente-cor-principal), #fff 72%);
}

body.portal-cliente .topbar,
body.portal-cliente .breadcrumb,
body.portal-cliente .breadcrumb-item,
body.portal-cliente .breadcrumb-item.active {
    color: #52656b;
}

body.portal-cliente .topbar-title strong,
body.portal-cliente .projects-heading h1,
body.portal-cliente .dashboard-hero h1 {
    color: #1f2937;
}

body.portal-cliente .projects-heading h1 i {
    color: #1f2937;
}

body.portal-cliente .summary-icon {
    background: color-mix(in srgb, var(--cliente-cor-destaque), #fff 82%);
    color: var(--cliente-cor-destaque);
}

body.portal-cliente .summary-card strong,
body.portal-cliente .summary-item strong {
    color: #17252a;
}

body.portal-cliente .btn-primary {
    --bs-btn-bg: var(--cliente-cor-botoes);
    --bs-btn-border-color: var(--cliente-cor-botoes);
    --bs-btn-color: var(--cliente-texto-botoes);
    --bs-btn-hover-bg: color-mix(in srgb, var(--cliente-cor-botoes), #000 12%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--cliente-cor-botoes), #000 12%);
    --bs-btn-hover-color: var(--cliente-texto-botoes);
    --bs-btn-active-bg: color-mix(in srgb, var(--cliente-cor-botoes), #000 18%);
    --bs-btn-active-border-color: color-mix(in srgb, var(--cliente-cor-botoes), #000 18%);
    --bs-btn-active-color: var(--cliente-texto-botoes);
}

body.portal-cliente .btn-outline-primary {
    --bs-btn-color: var(--cliente-cor-destaque);
    --bs-btn-border-color: var(--cliente-cor-destaque);
    --bs-btn-hover-bg: var(--cliente-cor-botoes);
    --bs-btn-hover-border-color: var(--cliente-cor-botoes);
    --bs-btn-hover-color: var(--cliente-texto-botoes);
    --bs-btn-active-bg: color-mix(in srgb, var(--cliente-cor-botoes), #000 12%);
    --bs-btn-active-border-color: color-mix(in srgb, var(--cliente-cor-botoes), #000 12%);
    --bs-btn-active-color: var(--cliente-texto-botoes);
}

body.portal-cliente .btn-success {
    --bs-btn-bg: var(--cliente-cor-botoes);
    --bs-btn-border-color: var(--cliente-cor-botoes);
    --bs-btn-color: var(--cliente-texto-botoes);
    --bs-btn-hover-bg: color-mix(in srgb, var(--cliente-cor-botoes), #000 12%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--cliente-cor-botoes), #000 12%);
    --bs-btn-hover-color: var(--cliente-texto-botoes);
}

body.portal-cliente .btn-client-view-activity {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #0f4c5c;
    --bs-btn-color: #0f4c5c;
    --bs-btn-hover-bg: #f3f8fa;
    --bs-btn-hover-border-color: #0b3d4a;
    --bs-btn-hover-color: #0b3d4a;
    --bs-btn-active-bg: #e7f1f4;
    --bs-btn-active-border-color: #0b3d4a;
    --bs-btn-active-color: #0b3d4a;
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #9fb7be;
    --bs-btn-disabled-color: #789098;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    opacity: 1;
}

body.portal-cliente .btn-client-view-activity i {
    color: currentColor;
}

body.portal-cliente .btn-client-view-activity:focus-visible {
    border-color: #0b3d4a;
    box-shadow: 0 0 0 .2rem rgba(15, 76, 92, .22);
}

body.portal-cliente a,
body.portal-cliente .breadcrumb-item a {
    color: var(--cliente-cor-destaque);
}

body.portal-cliente .form-control:focus,
body.portal-cliente .form-select:focus,
body.portal-cliente .btn:focus-visible {
    border-color: var(--cliente-cor-destaque);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--cliente-cor-destaque), transparent 78%);
}

body.portal-cliente .table thead th {
    border-bottom-color: var(--blm-border);
}

body.portal-cliente .company-detail-header,
body.portal-cliente .control-detail-accordion .accordion-button:not(.collapsed) {
    background: #eef7f8;
    color: #1f2937;
}

body.portal-cliente .company-detail-group {
    border-color: var(--blm-border);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--cliente-cor-destaque), #fff 20%);
}

body.portal-cliente .client-activity-table-wrapper thead th,
body.portal-cliente .table thead th {
    background: #edf5f6;
    color: #355057;
}

body.portal-cliente .visual-theme-badge {
    border: 1px solid color-mix(in srgb, var(--cliente-cor-destaque), #000 8%);
    background: color-mix(in srgb, var(--cliente-cor-destaque), #fff 76%);
    color: #17252a;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(7, 59, 68, .94), rgba(13, 111, 125, .88)),
        var(--blm-bg);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 430px);
    width: min(980px, 100%);
    min-height: 560px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(2, 32, 38, .28);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(6, 47, 56, .96), rgba(13, 111, 125, .9)),
        var(--blm-dark);
}

.auth-brand {
    width: min(260px, 100%);
    padding: 18px;
    background: #fff;
    border-radius: 8px;
    border-bottom: 4px solid var(--blm-accent);
}

.auth-brand img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.auth-copy {
    max-width: 420px;
}

.auth-kicker {
    display: inline-flex;
    margin-bottom: 12px;
    color: #b7efb2;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.auth-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
}

.auth-copy p {
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 1rem;
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px;
}

.auth-card h2 {
    margin: 0 0 6px;
    color: var(--blm-dark);
    font-size: 1.45rem;
    font-weight: 800;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: var(--sidebar-width);
    background: #062f38;
    border-right: 1px solid rgba(255, 255, 255, .08);
    transition: width .2s ease, transform .2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 104px;
    padding: 18px;
    background: #fff;
    border-bottom: 4px solid var(--blm-accent);
}

.brand-logo {
    width: 100%;
    max-width: 205px;
    height: auto;
    object-fit: contain;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
    padding: 16px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    width: 100%;
    padding: 9px 12px;
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: .93rem;
    text-align: left;
}

.sidebar .nav-link,
.sidebar .nav-link:focus,
.sidebar .nav-link:active,
.sidebar .nav-link:visited,
.sidebar .nav-toggle,
.sidebar .nav-toggle:focus,
.sidebar .nav-toggle:active,
.sidebar .nav-toggle[aria-expanded="false"] {
    color: rgba(255, 255, 255, .82);
    background: transparent;
    box-shadow: none;
}

.nav-link i {
    width: 22px;
    text-align: center;
    font-size: 1.05rem;
}

.nav-link:hover,
.nav-link.active,
.sidebar .nav-toggle[aria-expanded="true"] {
    color: #fff;
    background: rgba(72, 196, 63, .2);
}

.nav-link.active,
.sidebar .nav-toggle[aria-expanded="true"] {
    box-shadow: inset 3px 0 0 var(--blm-accent);
}

.nav-link.disabled,
.sidebar .nav-link.disabled,
.sidebar .nav-link.disabled:focus,
.sidebar .nav-link.disabled:active {
    color: rgba(255, 255, 255, .45);
    background: transparent;
    box-shadow: none;
    opacity: .58;
    cursor: not-allowed;
}

.nav-link small {
    margin-left: auto;
    padding: 2px 6px;
    color: #092f35;
    background: #a6e69f;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
}

.submenu {
    padding-left: 8px;
}

.submenu .nav-link {
    min-height: 38px;
    font-size: .88rem;
}

.main-content {
    width: 100%;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left .2s ease;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 70px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--blm-border);
    backdrop-filter: blur(8px);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--blm-dark);
    border: 1px solid var(--blm-border);
    background: #fff;
}

.topbar-title {
    min-width: 0;
    flex: 1;
}

.breadcrumb {
    font-size: .78rem;
}

.topbar-title strong {
    display: block;
    font-size: .95rem;
    color: var(--blm-dark);
}

.user-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #5b6f74;
    font-size: .9rem;
}

.content-area {
    padding: 24px;
}

.page-card,
.summary-card {
    background: #fff;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(7, 59, 68, .07);
}

.dashboard-hero {
    padding: 24px 28px;
    text-align: center;
}

.dashboard-logo {
    max-width: min(220px, 70vw);
    max-height: 70px;
    width: auto;
    height: auto;
    margin-bottom: 14px;
    object-fit: contain;
}

.dashboard-hero h1 {
    margin-bottom: 8px;
    font-size: clamp(1.2rem, 1.65vw, 1.55rem);
    color: var(--blm-dark);
}

.dashboard-hero p {
    max-width: 760px;
    margin: 0 auto;
    color: #607579;
    font-size: .92rem;
}

.client-dashboard-workspace {
    display: grid;
    gap: 22px;
    padding: 20px 24px 24px;
}

.client-dashboard-workspace .filter-card {
    padding: 18px;
}

.client-section-heading {
    margin-bottom: 12px;
}

.client-section-heading h2 {
    margin: 0 0 4px;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 800;
}

.client-section-heading p {
    margin: 0;
    color: #607579;
    font-size: .88rem;
}

.client-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 14px;
}

.client-status-card {
    --status-color: #64748b;
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 118px;
    padding: 16px;
    color: #17252a;
    text-align: left;
    background: #fff;
    border: 1px solid var(--blm-border);
    border-top: 4px solid var(--status-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(7, 59, 68, .07);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.client-status-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--status-color), #fff 42%);
    box-shadow: 0 14px 30px rgba(7, 59, 68, .12);
}

.client-status-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--status-color), transparent 65%);
    outline-offset: 2px;
}

.client-status-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--status-color);
    background: color-mix(in srgb, var(--status-color), #fff 86%);
    border-radius: 8px;
}

.client-status-card-body {
    display: grid;
    gap: 4px;
}

.client-status-card-body strong {
    font-size: .98rem;
}

.client-status-card-body small {
    color: #607579;
    font-weight: 700;
}

.client-status-card-action {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: max-content;
    color: var(--status-color);
    font-size: .78rem;
    font-weight: 800;
}

.client-status-card.status-pendente,
.client-status-badge.status-pendente {
    --status-color: #d68a00;
}

.client-status-card.status-em-andamento,
.client-status-card.status-lancados,
.client-status-badge.status-em-andamento {
    --status-color: #2563eb;
}

.client-status-card.status-finalizado,
.client-status-badge.status-finalizado {
    --status-color: #238636;
}

.client-status-card.status-cancelado,
.client-status-badge.status-cancelado {
    --status-color: #64748b;
}

.control-status-grid {
    display: grid;
    justify-content: end;
    grid-template-columns: repeat(2, minmax(150px, 230px));
    gap: 12px;
    margin-top: 14px !important;
}

.control-status-card {
    position: relative;
    overflow: hidden;
    min-height: 58px;
    padding: 9px 12px 18px;
    grid-template-columns: 30px 1fr;
    gap: 10px;
}

.control-status-card .client-status-card-icon {
    width: 30px;
    height: 30px;
}

.control-status-card .client-status-card-body strong {
    font-size: .86rem;
}

.control-status-card .client-status-card-body small,
.control-status-card .client-status-card-action {
    font-size: .72rem;
}

.control-filter-strip {
    display: grid;
    grid-template-columns: minmax(320px, 430px) minmax(280px, 1fr) minmax(220px, 300px);
    gap: 18px;
    align-items: end;
}

.control-filter-top-row {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    gap: 18px;
    align-items: end;
}

.control-filter-top-row.has-company-filter {
    grid-template-columns: minmax(300px, 1fr) minmax(190px, 240px) auto;
}

.control-filter-top-row.client-filter-top-row {
    grid-template-columns: minmax(280px, 50%) auto;
    justify-content: space-between;
}

.control-filter-top-row .control-status-grid {
    margin-top: 0 !important;
}

.filter-card:has(.control-filter-top-row) {
    padding: 16px 20px 20px;
}

.control-checkbox-filter-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

@media (max-width: 767.98px) {
    .filter-card:has(.control-filter-top-row) {
        padding: 14px;
    }

    .control-filter-top-row,
    .control-checkbox-filter-row {
        grid-template-columns: 1fr;
    }

    .control-filter-top-row.client-filter-top-row {
        grid-template-columns: 1fr;
    }

    .control-filter-top-row .control-status-grid {
        justify-content: stretch;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.filter-card:has(.control-filter-strip) {
    padding-left: 18px;
    padding-bottom: 18px;
}

.control-timeline-filter,
.control-company-filter,
.control-global-search,
.control-consultant-filter {
    min-width: 0;
}

.control-timeline-filter {
    display: grid;
    gap: 8px;
}

.control-cascade-section {
    padding: 0 8px 18px 8px;
}

.control-company-accordion,
.control-department-accordion {
    display: grid;
    gap: 10px;
}

.control-company-item,
.control-department-item {
    overflow: hidden;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
}

.control-company-item {
    transition: opacity .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.control-department-item {
    transition: opacity .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.control-company-item.is-muted {
    opacity: .42;
}

.control-department-item.is-muted {
    opacity: .48;
}

.control-company-item.is-open {
    opacity: 1;
    border-color: color-mix(in srgb, var(--blm-primary), #fff 45%);
    box-shadow: 0 10px 24px rgba(7, 59, 68, .09);
}

.control-department-item.is-open {
    opacity: 1;
    border-color: #d68a00;
}

.control-company-button,
.control-department-button {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) repeat(3, minmax(96px, 120px)) 32px;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    padding-right: 12px;
}

.control-company-button::after,
.control-department-button::after {
    grid-column: 5;
    justify-self: center;
    margin-left: 0;
}

.control-company-button .control-company-title,
.control-department-button .control-department-title {
    grid-column: 1;
}

.control-company-button .control-company-metrics,
.control-department-button .control-department-metrics {
    display: contents;
}

.control-company-button:not(.collapsed),
.control-department-button:not(.collapsed) {
    color: var(--blm-deep);
    background: #eef7f8;
    box-shadow: none;
}

.control-company-title {
    min-width: 0;
    color: var(--blm-deep);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-company-metrics {
    display: contents;
}

.control-company-metrics span {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.control-metric-group-label {
    align-self: center;
    color: #355057;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.control-company-metrics small,
.control-department-button small {
    color: #607579;
    font-size: .68rem;
    font-weight: 700;
}

.control-company-metrics strong {
    color: var(--blm-deep);
    font-size: .84rem;
}

.control-company-body {
    padding: 10px;
    background: #f8fbfc;
}

.control-department-body {
    padding: 0;
}

.control-department-button {
    padding: 7px 10px;
    padding-right: 12px;
    font-size: .9rem;
    font-weight: 800;
}

.control-department-title {
    min-width: 0;
    color: #198754;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-department-title small {
    margin-left: 6px;
    color: #198754;
    font-weight: 700;
}

.control-department-metrics {
    display: contents;
}

.control-department-metrics span {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.control-department-metrics small {
    color: #198754;
    font-size: .66rem;
    font-weight: 700;
}

.control-department-metrics strong {
    color: #198754;
    font-size: .8rem;
}

.control-department-header {
    display: flex;
    align-items: stretch;
}

.control-department-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    background: #eef7f8;
}

.control-department-actions .btn {
    width: 28px;
    height: 26px;
    padding: 0;
}

.control-project-groups {
    display: grid;
    gap: 12px;
    padding: 10px;
    background: #f8fbfc;
}

.control-project-group {
    overflow: hidden;
    border: 1px solid #dce8eb;
    border-radius: 8px;
    background: #fff;
}

.control-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    background: #f4fafb;
    border-bottom: 1px solid #dce8eb;
}

.control-project-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--blm-deep);
}

.control-project-title i {
    color: var(--blm-primary);
}

.control-project-title strong,
.control-project-title small {
    display: block;
}

.control-project-title strong {
    font-size: .94rem;
    font-weight: 800;
}

.control-project-title small {
    color: #607780;
    font-size: .78rem;
}

.control-project-metrics {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--blm-deep);
    text-align: right;
}

.control-project-metrics span {
    display: grid;
    gap: 2px;
}

.control-project-metrics small {
    color: var(--blm-deep);
    font-size: .7rem;
    font-weight: 700;
}

.control-project-metrics strong {
    color: var(--blm-deep);
    font-size: .92rem;
    line-height: 1;
}

.control-project-group .control-cascade-table-scroll {
    border-radius: 0;
}

.cascade-column-complete {
    min-height: 48px;
    justify-content: center;
}

.control-cascade-table-scroll {
    max-height: 360px;
    overflow: auto;
}

.control-cascade-table {
    min-width: 1080px;
    margin-bottom: 0;
    table-layout: fixed;
    font-size: .88rem;
}

.control-cascade-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    color: #355057;
    background: #e8f2f4;
    font-size: .72rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.control-cascade-table th,
.control-cascade-table td {
    padding: 4px 7px;
    vertical-align: middle;
}

.control-cascade-table thead th {
    padding-top: 6px;
    padding-bottom: 6px;
}

.control-cascade-table th:nth-child(1),
.control-cascade-table td:nth-child(1) {
    width: 105px;
}

.control-cascade-table th:nth-child(2),
.control-cascade-table td:nth-child(2) {
    width: 96px;
}

.control-cascade-table th:nth-child(3),
.control-cascade-table td:nth-child(3) {
    width: 92px;
}

.control-cascade-table th:nth-child(4),
.control-cascade-table td:nth-child(4),
.control-cascade-table th:nth-child(5),
.control-cascade-table td:nth-child(5) {
    width: 142px;
}

.control-cascade-table th:nth-child(6),
.control-cascade-table td:nth-child(6) {
    width: 158px;
}

.control-cascade-table th:nth-child(7),
.control-cascade-table td:nth-child(7) {
    width: 158px;
}

.cascade-project-consultor {
    display: inline-grid;
    gap: 1px;
    min-width: 0;
    line-height: 1.15;
}

.cascade-project-consultor strong {
    overflow-wrap: anywhere;
}

.cascade-project-consultor .badge {
    justify-self: start;
    padding: 1px 5px;
    color: #355057;
    border: 1px solid var(--blm-border);
    font-weight: 700;
    font-size: .7rem;
    line-height: 1.1;
}

.cascade-approval-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    color: #12333a;
    font-size: .78rem;
}

.cascade-approval-check .form-check-input {
    border-color: #198754;
    box-shadow: none;
}

.cascade-approval-check .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

.cascade-approval-check.activity-action-approved {
    color: #0f5132;
    font-weight: 800;
}

.cascade-approval-stack {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    white-space: nowrap;
    width: 100%;
}

.cascade-client-hours-button {
    border: 0;
    cursor: pointer;
    line-height: 1.2;
}

.cascade-client-hours-button:hover,
.cascade-client-hours-button:focus {
    filter: brightness(.95);
}

.control-time-text {
    color: #05313d;
    font-weight: 700;
    white-space: nowrap;
}

.cascade-column-controls {
    display: inline-grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    line-height: 1.15;
}

.cascade-column-controls > span:first-child {
    display: block;
}

.cascade-column-buttons {
    display: inline-flex;
    gap: 6px;
}

.cascade-approve-selected {
    min-width: 86px;
}

.cascade-column-buttons .btn {
    width: 26px;
    height: 24px;
    padding: 0;
}

.btn-icon-only {
    width: 34px;
    min-width: 34px;
    height: 32px;
    padding: 0;
}

.control-cascade-empty {
    margin: 0 8px 18px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
}

.control-status-card.status-todos {
    --status-color: #0d6f7d;
}

.control-status-card.is-active {
    border-color: var(--status-color);
    transform: translateY(-1px);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--status-color), #fff 48%),
        0 0 0 3px color-mix(in srgb, var(--status-color), transparent 78%),
        0 16px 32px rgba(7, 59, 68, .14);
}

.control-status-card.is-active::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--status-color);
}

.control-status-card.is-active::after {
    content: "Selecionado";
    position: absolute;
    right: 10px;
    bottom: 6px;
    color: var(--status-color);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.control-status-card.is-active .client-status-card-icon {
    color: #fff;
    background: var(--status-color);
}

.client-status-badge,
.client-activity-status {
    --status-color: #64748b;
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    padding: 4px 8px;
    color: color-mix(in srgb, var(--status-color), #000 28%);
    background: color-mix(in srgb, var(--status-color), #fff 82%);
    border: 1px solid color-mix(in srgb, var(--status-color), #fff 45%);
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.client-activity-status.status-em-analise,
.client-activity-status.status-enviado {
    --status-color: #d68a00;
}

.client-activity-status.status-aprovado {
    --status-color: #238636;
}

.client-activity-status.status-rejeitado {
    --status-color: #b42318;
}

.client-activity-status.status-cancelado {
    --status-color: #64748b;
}

.client-activity-status.status-rascunho {
    --status-color: #64748b;
}

.client-modal-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.client-modal-filter span {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    color: #1f2937;
    background: #eef2f6;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    padding: 18px;
}

.summary-card-button {
    appearance: none;
    width: 100%;
    text-align: left;
    color: inherit;
    background: #fff;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    box-shadow: var(--blm-shadow);
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.summary-card-button:hover,
.summary-card-button:focus {
    border-color: var(--blm-primary);
    box-shadow: 0 12px 28px rgba(5, 63, 74, .12);
    transform: translateY(-1px);
}

.summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #fff;
    background: var(--blm-deep);
    border-radius: 8px;
}

.summary-card strong {
    font-size: 1.65rem;
    color: var(--blm-dark);
}

.summary-card span {
    color: #62777b;
    font-size: .9rem;
}

.form-card {
    padding: 18px;
    margin-bottom: 18px;
}

.projects-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
}

.projects-heading h1 {
    margin: 0 0 8px;
    color: var(--blm-deep);
    font-size: clamp(1.55rem, 2vw, 2.15rem);
    font-weight: 800;
}

.projects-heading p {
    margin: 0;
    max-width: 760px;
    color: #526970;
}

.projects-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 16px 18px;
}

.project-cards-section {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 190px);
    min-height: 420px;
    overflow: hidden;
}

.project-cards-filters {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(260px, 1fr);
    gap: 12px;
    align-items: end;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--blm-border);
}

.project-timeline-filter,
.project-search {
    min-width: 0;
}

.project-timeline-filter {
    display: grid;
    gap: 8px;
}

.project-timeline-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--blm-dark);
    font-size: .82rem;
}

.project-timeline-labels span {
    color: #60737a;
    font-size: .78rem;
}

.project-timeline-labels b {
    color: var(--blm-dark);
}

.project-timeline-range {
    position: relative;
    height: 32px;
}

.project-timeline-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 14px;
    height: 4px;
    border-radius: 999px;
    background: #d9e8ec;
}

.project-timeline-range input[type="range"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    margin: 0;
    background: transparent;
    pointer-events: none;
    appearance: none;
}

.project-timeline-range input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--blm-primary);
    box-shadow: 0 2px 8px rgba(13, 111, 125, .25);
    cursor: pointer;
    pointer-events: auto;
    appearance: none;
}

.project-timeline-range input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--blm-primary);
    box-shadow: 0 2px 8px rgba(13, 111, 125, .25);
    cursor: pointer;
    pointer-events: auto;
}

.project-cards-scroll {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 18px 18px;
    overflow-y: auto;
}

.project-table-shell {
    height: 100%;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
}

.project-list-table {
    margin: 0;
    min-width: 980px;
}

.category-list-table {
    min-width: 680px;
}

.category-empty-row td {
    height: 220px;
    border-bottom: 0;
    vertical-align: middle;
}


.project-list-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: var(--blm-dark);
    background: #edf5f6;
    border-bottom: 1px solid var(--blm-border);
    font-size: .76rem;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.project-list-table tbody td {
    vertical-align: middle;
}

.project-title-cell {
    min-width: 280px;
}

.project-title-cell strong {
    display: block;
    color: var(--blm-dark);
    line-height: 1.25;
}

.project-title-cell small {
    display: block;
    max-width: 520px;
    margin-top: 4px;
    color: #607579;
    line-height: 1.35;
}

.project-hours-badge {
    color: var(--blm-dark) !important;
    border: 1px solid var(--blm-border);
}

.project-file-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--blm-dark);
    font-weight: 800;
}

.project-summary-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
}

.project-summary-topline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    color: #315159;
    font-size: .78rem;
    font-weight: 800;
}

.project-summary-topline > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-company-logo-box {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--blm-border);
    border-radius: 5px;
    background: #f5fafb;
    overflow: hidden;
}

.project-company-logo {
    max-width: 18px;
    max-height: 18px;
    object-fit: contain;
}

.project-company-logo-fallback {
    color: var(--blm-primary);
    font-size: .82rem;
}

.project-summary-card h2 {
    margin: 0;
    color: var(--blm-dark);
    font-size: 1rem;
    font-weight: 900;
}

.project-summary-card p {
    margin: 0;
    color: #60737a;
    font-size: .86rem;
}

.project-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #315159;
    font-size: .78rem;
    font-weight: 700;
}

.project-summary-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.project-summary-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

@media (max-width: 1199.98px) {
    .project-cards-scroll {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .project-cards-section {
        height: calc(100vh - 170px);
        min-height: 360px;
    }

    .project-cards-filters {
        grid-template-columns: 1fr;
    }

    .project-cards-scroll {
        grid-template-columns: 1fr;
    }
}

.consultant-projects-entry {
    padding: 18px;
    margin-bottom: 18px;
}

.consultant-projects-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.drag-handle {
    color: #6b7c82;
    cursor: grab;
}

.dragging {
    opacity: .55;
}

.consultant-project-card {
    margin-bottom: 10px;
}

#projectsModal #recordsMobile {
    display: none;
}

.projects-modal-dialog {
    max-width: min(1120px, 96vw);
}

.projects-modal-content {
    height: min(640px, 88vh);
    max-height: 88vh;
}

.projects-modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 14px 12px;
}

.projects-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.projects-drag-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 1 auto;
    max-width: 100%;
    padding: 8px 10px;
    color: #5f4700 !important;
    font-weight: 700;
    white-space: nowrap;
    text-align: left;
}

.projects-modal-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}

.projects-status-filter {
    width: 150px;
    max-width: 150px;
    flex: 0 0 150px;
}

.projects-search {
    width: 280px;
    max-width: 280px;
    flex: 0 0 280px;
}

#projectsModal .projects-status-filter {
    width: 150px !important;
}

#projectsModal .projects-search {
    width: 280px;
}

#projectsModal .desktop-table-section {
    flex: 1 1 auto;
    min-height: 260px;
    max-height: none;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

#projectsModal .desktop-table-section thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #e8f2f4;
}

#projectsModal .pagination-bar {
    flex: 0 0 auto;
    margin-top: 10px;
    padding: 10px 8px 0;
    border-top: 1px solid var(--blm-border);
}

@media (max-width: 767.98px) {
    #projectsModal .projects-modal-content {
        height: 100vh;
        max-height: 100vh;
    }

    #projectsModal #recordsMobile {
        display: grid;
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }
}

.form-card h1,
.table-card h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--blm-dark);
}

.form-label {
    margin-bottom: 5px;
    font-size: .83rem;
    font-weight: 700;
    color: #355057;
}

.form-control,
.form-select {
    min-height: 38px;
    border-color: var(--blm-border);
    font-size: .9rem;
}

.select-full-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.btn-primary {
    --bs-btn-bg: var(--blm-accent-dark);
    --bs-btn-border-color: var(--blm-accent-dark);
    --bs-btn-hover-bg: #075985;
    --bs-btn-hover-border-color: #075985;
}

.btn-outline-primary {
    --bs-btn-color: var(--blm-deep);
    --bs-btn-border-color: var(--blm-deep);
    --bs-btn-hover-bg: var(--blm-deep);
    --bs-btn-hover-border-color: var(--blm-deep);
}

.table-card {
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--blm-border);
}

.table-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-bar-inline {
    padding: 0;
    border-top: 0 !important;
    min-width: max-content;
}

.users-table-toolbar {
    align-items: flex-start;
}

.users-toolbar-controls {
    display: grid;
    grid-template-columns: 290px minmax(280px, 1fr);
    align-items: start;
    gap: 10px;
    width: min(100%, 560px);
}

.users-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.users-search {
    width: 100%;
}

#identityModal .modal-dialog {
    margin-top: .5rem;
    margin-bottom: .5rem;
}

#identityModal .modal-content,
#identityForm {
    max-height: calc(100vh - 1rem);
}

#identityForm {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#identityModal .modal-header,
#identityModal .modal-footer {
    flex: 0 0 auto;
}

#identityModal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.visual-identity-logo-box {
    display: grid;
    gap: 8px;
}

.visual-identity-logo-preview {
    display: grid;
    place-items: center;
    min-height: 78px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #f7fbfb;
    padding: 12px;
}

.visual-identity-logo-preview img {
    max-width: min(220px, 100%);
    max-height: 74px;
    object-fit: contain;
}

.visual-color-field {
    display: grid;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--blm-border);
}

.visual-color-control {
    display: grid;
    grid-template-columns: 48px minmax(120px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.visual-color-control input[type="color"] {
    width: 48px;
    height: 38px;
    padding: 3px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
}

.visual-preview {
    --preview-main: var(--blm-deep);
    --preview-button: var(--blm-accent-dark);
    --preview-accent: var(--blm-accent);
    --preview-main-text: #fff;
    --preview-button-text: #fff;
    --preview-accent-text: #17252a;
    display: grid;
    grid-template-columns: minmax(160px, 180px) 1fr;
    min-height: clamp(220px, calc(100vh - 220px), 320px);
    overflow: hidden;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
}

.visual-preview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--preview-main);
    color: var(--preview-main-text);
}

.visual-preview-brand {
    display: grid;
    place-items: center;
    min-height: 68px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .24);
    font-weight: 800;
}

.visual-preview-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    border-radius: 8px;
    padding: 9px 10px;
    color: inherit;
    overflow-wrap: anywhere;
}

.visual-preview-nav i {
    color: var(--preview-accent);
}

.visual-preview-nav.active {
    background: var(--preview-accent);
    color: var(--preview-accent-text);
    font-weight: 800;
}

.visual-preview-nav.active i {
    color: var(--preview-accent-text);
}

.visual-preview-main {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 18px;
    background: #f4f8f9;
}

.visual-preview-button {
    width: max-content;
    background: var(--preview-button);
    border-color: var(--preview-button);
    color: var(--preview-button-text);
    font-weight: 800;
}

.visual-preview-button:hover {
    background: color-mix(in srgb, var(--preview-button), #000 12%);
    border-color: color-mix(in srgb, var(--preview-button), #000 12%);
    color: var(--preview-button-text);
}

.visual-preview-card {
    display: grid;
    gap: 5px;
    max-width: 220px;
    border: 1px solid color-mix(in srgb, var(--preview-accent), #fff 62%);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.visual-preview-card .summary-icon {
    color: var(--preview-accent);
}

.visual-preview-badge {
    width: max-content;
    border: 1px solid color-mix(in srgb, var(--preview-accent), #000 10%);
    border-radius: 999px;
    padding: 5px 9px;
    background: color-mix(in srgb, var(--preview-accent), #fff 72%);
    color: #17252a;
    font-size: .78rem;
    font-weight: 800;
}

.users-list-trigger-card {
    display: flex;
    justify-content: flex-start;
    padding: 16px 18px;
}

.users-list-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.users-page-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
    min-height: 0;
    padding: 16px;
    overflow: hidden;
}

.users-page-list .modal-usuarios-filtros {
    flex: 0 0 auto;
}

.users-page-list .modal-usuarios-tabela-wrapper {
    flex: 0 1 auto;
    max-height: min(486px, calc(100dvh - 260px));
    scrollbar-gutter: stable;
}

.users-page-list .modal-usuarios-rodape {
    flex: 0 0 auto;
    display: flex;
}

.modal-usuarios .modal-dialog {
    max-width: 95vw;
}

.modal-usuarios .modal-content {
    height: 90vh;
    overflow: hidden;
}

.modal-usuarios .modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
    padding: 16px;
}

.modal-usuarios-filtros {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-usuarios .users-toolbar-controls,
.users-page-list .users-toolbar-controls {
    grid-template-columns: minmax(260px, 1fr) 290px;
    align-items: center;
    width: min(100%, 760px);
}

.modal-usuarios .table-search,
.users-page-list .table-search {
    max-width: none;
}

.modal-usuarios-tabela-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.modal-usuarios .users-modal-table,
.users-page-list .users-modal-table {
    min-width: 980px;
}

.modal-usuarios .users-modal-table thead th,
.users-page-list .users-modal-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
}

.users-page-list .users-modal-table thead tr {
    height: 38px;
}

.users-page-list .users-modal-table tbody tr {
    height: 56px;
}

.modal-usuarios-rodape {
    flex: 0 0 auto;
    justify-content: space-between;
}

@media (max-width: 991.98px) {
    .modal-usuarios-filtros {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-usuarios .users-toolbar-controls {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .modal-usuarios .modal-content {
        height: 100vh;
    }

    .modal-usuarios .modal-body {
        padding: 12px;
    }

    .modal-usuarios-rodape {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-usuarios-rodape .d-flex {
        justify-content: space-between;
    }
}

.table-search {
    max-width: 320px;
}

.table-scroll {
    max-height: 390px;
    overflow: auto;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #355057;
    background: #edf5f6;
    border-bottom: 1px solid var(--blm-border);
    font-size: .78rem;
    text-transform: uppercase;
}

body[data-page="setores"] .desktop-table-section .table-scroll {
    max-height: min(58vh, 560px);
    overflow: auto;
}

body[data-page="setores"].departments-table-open {
    overflow: hidden;
}

body[data-page="setores"].departments-table-open .app-shell {
    height: 100vh;
    min-height: 100vh;
}

body[data-page="setores"].departments-table-open .main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

body[data-page="setores"].departments-table-open .content-área {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 0 0;
    overflow: hidden;
}

body[data-page="setores"].departments-table-open .form-card {
    display: none;
}

body[data-page="setores"].departments-table-open .desktop-table-section {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    width: 80%;
    min-height: 0;
    margin: 0 auto;
    border-radius: 8px 8px 0 0;
}

@media (max-width: 767.98px) {
    body[data-page="setores"].departments-table-open .desktop-table-section {
        width: 100%;
    }
}

body[data-page="setores"].departments-table-open .desktop-table-section .table-toolbar {
    flex: 0 0 auto;
}

body[data-page="setores"].departments-table-open .desktop-table-section .table-scroll {
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(422px, calc(100dvh - 190px));
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
    border-top: 1px solid var(--blm-border);
}

body[data-page="setores"].departments-table-open .desktop-table-section .table thead tr {
    height: 38px;
}

body[data-page="setores"].departments-table-open .desktop-table-section .table tbody tr {
    height: 48px;
}

body[data-page="setores"].departments-table-open .desktop-table-section .table-scroll::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

body[data-page="setores"].departments-table-open .desktop-table-section .table-scroll::-webkit-scrollbar-track {
    background: #edf3f4;
}

body[data-page="setores"].departments-table-open .desktop-table-section .table-scroll::-webkit-scrollbar-thumb {
    background: #789096;
    border: 2px solid #edf3f4;
    border-radius: 6px;
}

body[data-page="setores"] .desktop-table-section .table {
    margin-bottom: 0;
}

body[data-page="setores"] .table-toolbar {
    flex-wrap: nowrap;
}

body[data-page="setores"] .table-toolbar-actions {
    flex-wrap: nowrap;
    width: auto;
}

body[data-page="setores"] .table-toolbar-actions .table-search {
    width: 320px;
    flex: 0 0 320px;
}

body[data-page="setores"] .pagination-bar-inline {
    display: none;
}

body[data-page="setores"] .desktop-table-section > .pagination-bar {
    display: none;
}

.departments-company-section {
    margin-bottom: 16px;
}

.departments-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    padding: 14px 18px 18px;
}

.department-company-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 10px;
    text-align: left;
    background: #fff;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    color: var(--blm-dark);
}

.department-company-card:hover,
.department-company-card:focus {
    border-color: var(--blm-primary);
    box-shadow: 0 8px 18px rgba(13, 111, 125, .12);
}

.department-company-media {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #f5fafb;
    overflow: hidden;
}

.department-company-logo {
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

.department-company-logo-fallback {
    color: var(--blm-primary);
    font-size: 1.25rem;
}

.department-company-info {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.department-company-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .95rem;
}

.department-company-info small {
    color: #60737a;
    font-weight: 700;
}

body[data-page="empresas"] .desktop-table-section .table-responsive {
    display: none;
}

body[data-page="empresas"] .desktop-table-section {
    overflow: hidden;
}

.empresa-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 14px 18px 18px;
}

.empresa-summary-card {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
}

.empresa-summary-card:hover {
    border-color: var(--blm-primary);
    box-shadow: 0 8px 18px rgba(13, 111, 125, .12);
}

.empresa-summary-header {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.empresa-summary-logo {
    display: grid;
    place-items: center;
    width: 54px;
    height: 46px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #f5fafb;
    overflow: hidden;
}

.empresa-summary-logo-img {
    max-width: 46px;
    max-height: 38px;
    object-fit: contain;
}

.company-logo-fallback {
    color: var(--blm-primary);
    font-size: 1.25rem;
}

.empresa-summary-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.empresa-summary-title strong,
.empresa-summary-title small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empresa-summary-title small,
.empresa-summary-metrics small {
    color: #60737a;
    font-size: .72rem;
    font-weight: 700;
}

.empresa-summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.empresa-summary-metrics span {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #f8fbfc;
}

.empresa-summary-metrics strong,
.empresa-summary-metrics .badge {
    width: max-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empresa-summary-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.company-department-popover {
    position: absolute;
    inset: 8px;
    z-index: 5;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid var(--blm-primary);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(13, 111, 125, .18);
    overflow: hidden;
}

.company-department-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--blm-border);
    border-radius: 6px;
    background: #f5fafb;
    color: var(--blm-dark);
    font-size: .72rem;
}

.company-department-popover-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 8px 36px 6px 10px;
    color: var(--blm-dark);
    font-size: .78rem;
    font-weight: 700;
}

.company-department-popover-body {
    min-height: 0;
    overflow: auto;
    padding: 0 8px 8px;
}

.company-financial-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    padding-top: 4px;
}

.company-financial-form .form-label {
    grid-column: 1 / -1;
    margin-bottom: -2px;
}

.company-department-list {
    display: grid;
    gap: 6px;
}

.company-department-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--blm-border);
    border-radius: 6px;
    background: #f8fbfc;
    font-size: .74rem;
}

.company-department-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-department-item span {
    color: #60737a;
}

.actions-cell {
    position: sticky;
    right: 0;
    z-index: 1;
    min-width: 112px;
    background: #fff;
    box-shadow: -8px 0 12px rgba(255, 255, 255, .85);
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}

.status-badge.ativo {
    color: #17651d;
    background: #dff5db;
}

.status-badge.inativo {
    color: #78610c;
    background: #fff2bd;
}

.assignment-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-pendente {
    color: #7a4b00;
    background: #fff0c2;
}

.status-em-andamento {
    color: #0d5d8c;
    background: #dff1ff;
}

.status-finalizado {
    color: #17651d;
    background: #dff5db;
}

.status-cancelado {
    color: #6d3333;
    background: #f3dddd;
}

.assignment-projects-card {
    padding: 18px;
}

.assignment-departments-card {
    width: min(1120px, 100%);
    margin: 0 auto;
    overflow: hidden;
}

.assignment-departments-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--blm-border);
}

.assignment-departments-title h1,
.assignment-departments-card .table-toolbar h2 {
    margin: 0;
    color: var(--blm-dark);
    font-size: 1.05rem;
}

.assignment-view-toolbar {
    border-bottom: 1px solid var(--blm-border);
}

.assignment-departments-card .assignment-view-toolbar,
.assignment-departments-card .assignment-view-toolbar .table-toolbar-actions {
    flex-wrap: nowrap;
}

.assignment-departments-card .assignment-view-toolbar .table-toolbar-actions {
    flex: 0 0 auto;
}

.assignment-departments-card .assignment-view-toolbar .btn {
    white-space: nowrap;
}

.assignment-departments-card .assignment-view-toolbar .table-search {
    width: 320px;
    flex: 0 0 320px;
}

.assignment-departments-list {
    max-height: min(590px, calc(100dvh - 240px));
    padding: 14px 18px 18px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.assignment-department-button {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) minmax(120px, .7fr) minmax(140px, .8fr);
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 12px 42px 12px 14px;
    color: var(--blm-deep);
    background: #fff;
    font-size: .9rem;
    font-weight: 700;
    text-align: left;
}

.assignment-department-button:not(.collapsed) {
    color: var(--blm-deep);
    background: #eef7f8;
    box-shadow: none;
}

.assignment-open-activities {
    color: #a33a26;
}

@media (max-width: 767.98px) {
    .assignment-departments-card {
        width: 100%;
    }

    .assignment-departments-card .assignment-view-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .assignment-departments-card .table-toolbar-actions,
    .assignment-departments-card .table-search {
        width: 100%;
        max-width: none;
    }

    .assignment-department-button {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.assignment-projects-card h1 {
    margin: 0;
    color: var(--blm-dark);
    font-size: 1.15rem;
    line-height: 1.2;
}

.assignment-projects-card h1 i {
    font-size: 1rem;
}

.assignment-project-filters {
    margin: 0 -18px 14px;
    padding-top: 12px;
}

.assignment-projects-host {
    display: grid;
    gap: 10px;
}

.assignment-projects-head,
.assignment-project-button {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(220px, 1.6fr) 96px;
    gap: 12px;
    align-items: center;
}

.assignment-projects-head {
    padding: 9px 42px 9px 14px;
    color: #355057;
    background: #e8f2f4;
    border: 1px solid var(--blm-border);
    border-radius: 8px 8px 0 0;
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.assignment-projects-accordion {
    display: grid;
    gap: 8px;
}

.assignment-project-item {
    overflow: hidden;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
    opacity: .38;
    transition: opacity .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.assignment-project-item.is-open,
.assignment-project-item:has(.accordion-collapse.show) {
    opacity: 1;
    border-color: color-mix(in srgb, var(--blm-primary), #fff 35%);
    box-shadow: 0 10px 24px rgba(7, 59, 68, .08);
}

.assignment-project-button {
    width: 100%;
    padding: 12px 42px 12px 14px;
    color: var(--blm-deep);
    background: #fff;
    font-size: .9rem;
    font-weight: 700;
    text-align: left;
}

.assignment-project-button:not(.collapsed) {
    color: var(--blm-deep);
    background: #eef7f8;
    box-shadow: none;
}

.assignment-project-name,
.assignment-project-company,
.assignment-project-department {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assignment-project-count {
    color: #667085;
    font-size: .78rem;
}

.assignment-project-body {
    display: grid;
    gap: 14px;
    padding: 14px;
    background: #f8fbfc;
}

.assignment-project-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.assignment-project-toolbar small {
    display: block;
    color: #667085;
    font-size: .78rem;
}

.assignment-project-actions {
    display: inline-flex;
    gap: 8px;
}

.assignment-consultor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.assignment-consultor-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    margin: 0;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
    font-weight: 700;
}

.assignment-consultor-check small {
    margin-left: auto;
    color: #667085;
    font-size: .68rem;
    font-weight: 700;
}

.assignment-consultor-check.is-disabled {
    opacity: .72;
}

@media (max-width: 991.98px) {
    .assignment-projects-head {
        display: none;
    }

    .assignment-project-button {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .assignment-consultor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .assignment-consultor-grid {
        grid-template-columns: 1fr;
    }
}

.priority-baixa {
    color: #345a68;
    background: #e6f0f4;
}

.priority-media {
    color: #7a5a00;
    background: #fff2bd;
}

.priority-alta {
    color: #8a3b00;
    background: #ffe0cc;
}

.priority-nao-definida {
    color: #5b6570;
    background: #edf0f2;
}

.company-logo-thumb {
    width: 46px;
    height: 32px;
    object-fit: contain;
    padding: 3px;
    background: #fff;
    border: 1px solid var(--blm-border);
    border-radius: 6px;
}

.company-logo-preview {
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.empty-state {
    padding: 42px 16px;
    color: #607579;
    text-align: center;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--blm-border);
    font-size: .86rem;
}

.mobile-records-button {
    display: none;
}

.mobile-records-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-height: 76px;
    color: #fff;
    background: var(--blm-deep);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(7, 59, 68, .12);
}

.mobile-records-trigger:hover,
.mobile-records-trigger:focus {
    color: #fff;
    background: #096270;
}

.mobile-records-trigger span {
    font-weight: 700;
}

.mobile-records-trigger small {
    font-size: .78rem;
    opacity: .86;
}

.records-modal-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
    border-bottom: 1px solid var(--blm-border);
}

.records-modal-body {
    overflow: auto;
}

.records-modal-footer {
    background: #fff;
}

.records-entry-card {
    padding: 18px;
}

.modal-tabela-confortavel .modal-dialog {
    max-width: min(1180px, 96vw);
}

.modal-tabela-confortavel .modal-content {
    height: min(88vh, 820px);
}

.modal-tabela-confortavel .records-modal-content {
    display: flex;
    flex-direction: column;
}

.modal-tabela-confortavel .records-modal-header {
    flex: 0 0 auto;
    z-index: 5;
}

.modal-tabela-confortavel .records-modal-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.modal-tabela-confortavel .records-modal-body > .d-flex,
.modal-tabela-confortavel .records-modal-body > .input-group {
    flex: 0 0 auto;
}

.modal-summary-row {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px;
}

.modal-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 10px 12px;
    background: #edf5f6;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.modal-summary-item span {
    color: #355057;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.modal-summary-item strong {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    color: #fff;
    background: #0f8d63;
    border-radius: 6px;
    font-size: .82rem;
}

.hours-contract-heading {
    margin-bottom: 12px;
}

.hours-contract-list-card {
    padding: 0 8px 14px;
}

.hours-contract-filters {
    grid-template-columns: minmax(280px, 320px) minmax(360px, 1fr);
    margin: 0 -8px 14px;
    padding: 16px 8px 12px;
}

.hours-contract-summary {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
}

@media (max-width: 991.98px) {
    .hours-contract-filters {
        grid-template-columns: 1fr;
    }

    .hours-contract-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .hours-contract-summary {
        grid-template-columns: 1fr;
    }
}

.modal-tabela-confortavel .records-modal-body .table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.modal-tabela-confortavel .table {
    min-width: 980px;
}

.modal-tabela-confortavel .table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
}

.modal-tabela-confortavel .records-modal-footer {
    flex: 0 0 auto;
}

.modal-atribuicoes .modal-dialog {
    max-width: 95vw;
}

.modal-atribuicoes .modal-content {
    height: 90vh;
}

.modal-atribuicoes .records-modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-atribuicoes .table-search {
    flex: 0 0 auto;
}

.modal-atribuicoes .tabela-atribuicoes-wrapper {
    flex: 1 1 auto;
    max-height: none;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.modal-atribuicoes .table thead th {
    background: #e8f2f4;
    z-index: 4;
}

.priority-inline-select {
    min-width: 150px;
}

.modal-pagamentos-consultores .modal-dialog {
    max-width: 95vw;
}

.modal-pagamentos-consultores .modal-content {
    height: 90vh;
}

.modal-pagamentos-consultores .modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}

.pagamentos-filtros,
.pagamentos-resumo {
    flex: 0 0 auto;
}

.pagamentos-resumo {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.payment-summary-card {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
}

.payment-summary-card small {
    display: block;
    color: #60737a;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.payment-summary-card strong {
    display: block;
    color: var(--blm-dark);
    font-size: 1.2rem;
}

.pagamentos-tabela-wrapper {
    flex: 1 1 auto;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
}

.pagamentos-table {
    margin-bottom: 0;
}

.pagamentos-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #e8f2f4;
}

.payment-mobile-list {
    display: none;
}

.payment-mobile-card {
    display: grid;
    gap: 10px;
    border-bottom: 1px solid var(--blm-border);
    padding: 12px;
}

.payment-mobile-card:last-child {
    border-bottom: 0;
}

.payment-mobile-card small {
    display: block;
    color: #60737a;
}

.payment-mobile-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.payment-mobile-card dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.payment-mobile-card dt {
    color: #60737a;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.payment-mobile-card dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
}

.payment-consultor-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.payment-card-button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.payment-entry-modal-dialog {
    max-width: min(760px, calc(100vw - 24px));
}

.payment-history-mode .payment-entry-modal-dialog {
    height: min(780px, 94vh);
    max-width: min(1320px, 98vw);
}

.payment-entry-modal {
    overflow: hidden;
}

.payment-history-mode .payment-entry-modal {
    height: 100%;
}

.payment-entry-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
}

.payment-entry-heading {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    min-width: 0;
}

.payment-entry-header-date {
    width: 180px;
}

.payment-history-mode .payment-entry-header-date {
    display: none;
}

.payment-entry-header-date .form-label {
    margin-bottom: 4px;
}

.payment-entry-header-date .form-control[readonly] {
    background: #f8fafb;
    cursor: default;
}

.payment-entry-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.payment-entry-observation {
    min-width: 0;
    grid-column: 1 / -1;
}

@media (max-width: 991.98px) {
    .payment-entry-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .payment-entry-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-entry-observation {
        grid-column: 1 / -1;
    }
}

.payment-entry-submit {
    align-self: end;
    grid-column: 1 / -1;
    justify-self: end;
}

.payment-entry-submit .btn {
    min-width: 120px;
}

.payment-history-filter {
    display: grid;
    grid-template-columns: minmax(150px, 180px) max-content;
    gap: 12px;
    align-items: end;
    padding-top: 4px;
}

.payment-history-filter-button {
    min-width: 110px;
}

.payment-history-table-wrap {
    flex: 1 1 auto;
    min-height: 220px;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.payment-history-table {
    margin-bottom: 0;
}

.payment-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e8f2f4;
}

.payment-history-table tfoot th {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #f3f7f8;
    border-top: 2px solid var(--blm-border);
}

.payment-history-table tfoot th:first-child {
    text-align: right;
}

.consultor-payment-history-table tfoot th {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #f3f7f8;
    border-top: 2px solid var(--blm-border);
}

.payment-edit-button {
    padding: 0 4px;
    vertical-align: baseline;
}

.financeiro-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: calc(100vh - 132px);
    padding-bottom: 16px;
}

.financeiro-header-competence {
    width: 180px;
}

.financeiro-header-competence .form-label {
    margin-bottom: 4px;
}

.financeiro-header-competence .form-control[readonly] {
    background: #f8fafb;
    cursor: default;
}

.financeiro-page .pagamentos-filtros,
.financeiro-page .pagamentos-resumo,
.financeiro-page #paymentMissingRateAlert {
    margin-right: 18px;
    margin-left: 18px;
}

.financeiro-page .pagamentos-tabela-wrapper {
    margin-right: 18px;
    margin-left: 18px;
    max-height: min(58vh, 620px);
}

@media (max-width: 575.98px) {
    .financeiro-page > .table-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

.consultor-records-modal-dialog {
    height: min(640px, 88vh);
    max-width: min(1120px, 96vw);
}

.consultor-records-modal {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.consultor-records-modal .records-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.consultor-records-table-scroll {
    flex: 1 1 auto;
    min-height: 260px;
    max-height: none;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.consultor-records-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #e8f2f4;
}

.dashboard-lancamentos-filters {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(170px, 210px) minmax(240px, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.dashboard-lancamentos-search {
    max-width: none;
}

.consultant-status-section {
    margin-bottom: 18px;
}

@media (max-width: 767.98px) {
    .dashboard-lancamentos-filters {
        grid-template-columns: 1fr;
    }
}

.consultor-records-table-scroll tbody td {
    vertical-align: middle;
}

.consultor-stacked-modal-dialog {
    height: min(620px, 86vh);
    max-width: min(1040px, 96vw);
}

.consultor-stacked-modal-content {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    border: 2px solid #f59e0b;
    border-radius: 8px;
}

.consultor-stacked-modal-content .modal-header,
.consultor-stacked-modal-content .modal-footer {
    flex: 0 0 auto;
    border-color: #f8d58a;
}

.consultor-stacked-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.financeiro-lancamentos-modal {
    height: min(86vh, 820px);
}

.financeiro-period-filters {
    display: grid;
    grid-template-columns: minmax(300px, 42%) minmax(180px, 220px) minmax(180px, 220px) auto;
    gap: 16px;
    align-items: end;
}

.financeiro-period-timeline,
.financeiro-period-date {
    min-width: 0;
}

.financeiro-period-action {
    display: flex;
    justify-content: end;
}

@media (max-width: 991.98px) {
    .financeiro-period-filters {
        grid-template-columns: 1fr 1fr;
    }

    .financeiro-period-timeline {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .financeiro-period-filters {
        grid-template-columns: 1fr;
    }

    .financeiro-period-timeline {
        grid-column: auto;
    }

    .financeiro-period-action,
    .financeiro-period-action .btn {
        width: 100%;
    }
}

.financeiro-lancamentos-modal .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.financeiro-table-scroll {
    flex: 1 1 auto;
    min-height: 280px;
    max-height: calc(86vh - 150px);
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.financeiro-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #e8f2f4;
}

.gestor-detail-modal-dialog {
    max-width: min(1320px, 96vw);
    height: 96vh;
    margin-top: 2vh;
    margin-bottom: 2vh;
}

.gestor-detail-modal {
    height: 100%;
    min-height: 100%;
}

.gestor-detail-modal .records-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    padding: 16px;
}

.gestor-detail-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
    margin-bottom: 2px;
}

.gestor-detail-desktop-search {
    width: min(420px, 100%);
    max-width: 420px;
}

.gestor-detail-mobile,
.gestor-detail-mobile-search {
    display: none !important;
}

.gestor-detail-desktop {
    display: block !important;
}

.gestor-detail-modal .control-detail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding-right: 2px;
}

.gestor-detail-modal .company-detail-group {
    margin-bottom: 0;
}

.gestor-detail-modal .control-detail-table-scroll {
    max-height: 360px;
    overflow: auto;
}

.gestor-detail-modal .control-detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
}

.company-detail-modal-dialog {
    max-width: min(1280px, 98vw);
    height: min(640px, 86vh);
}

.company-detail-modal-content {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    border: 2px solid #0d6f7d;
    border-radius: 8px;
}

.company-detail-modal-content .modal-header,
.company-detail-modal-content .modal-footer {
    flex: 0 0 auto;
    border-color: color-mix(in srgb, #0d6f7d, #fff 68%);
}

.company-detail-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 14px 16px;
}

.company-detail-modal-body .control-detail-table-scroll {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: none;
    overflow: auto;
    border: 1px solid color-mix(in srgb, #0d6f7d, #fff 62%);
    border-radius: 8px;
}

.company-detail-modal-body .control-detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #e8f2f4;
}

.assignment-activities-modal-dialog {
    max-width: min(1280px, 96vw);
    height: min(660px, 88vh);
}

.assignment-activities-modal-content {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    border: 2px solid #0d6f7d;
    border-radius: 8px;
}

.assignment-activities-modal-content .modal-header,
.assignment-activities-modal-content .modal-footer {
    flex: 0 0 auto;
    border-color: color-mix(in srgb, #0d6f7d, #fff 68%);
}

.assignment-activities-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 14px 16px;
}

.assignment-activities-modal-body .assignment-summary-card {
    flex: 0 0 auto;
    margin-bottom: 0 !important;
}

.assignment-activities-modal-body .assignment-detail-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.assignment-activities-modal-body .activities-scroll-table {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: none;
    overflow: auto;
}

.assignment-activities-modal-body .activities-scroll-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #e8f2f4;
}

.control-summary-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.control-company-summary-table {
    min-width: 980px;
    margin-bottom: 0;
    table-layout: fixed;
}

.control-company-summary-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #e8f2f4;
    color: #355057;
    font-size: .78rem;
    text-transform: uppercase;
}

.control-company-summary-table th,
.control-company-summary-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.control-company-summary-table th:first-child,
.control-company-summary-table td:first-child {
    width: 22%;
    overflow-wrap: anywhere;
}

.control-company-summary-table th:nth-child(2),
.control-company-summary-table td:nth-child(2),
.control-company-summary-table th:last-child,
.control-company-summary-table td:last-child {
    width: 96px;
}

.mobile-table-scroll {
    max-height: calc(95vh - 210px);
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .brand-logo {
    max-width: 52px;
}

body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .nav-link small,
body.sidebar-collapsed .submenu-caret {
    display: none;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
}

.mobile-record-card {
    display: grid;
    gap: 6px;
    padding: 4px 0;
    white-space: normal;
}

.control-hours-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.control-hours-heading h1,
.section-title {
    color: var(--blm-deep);
    font-size: 1.05rem;
    font-weight: 800;
}

.control-hours-heading p {
    margin: 6px 0 0;
    color: #5d6f75;
}

.control-hours-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 430px;
    padding: 10px 12px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #f5fafb;
    color: #49666e;
    font-size: .86rem;
}

.control-hours-note .btn-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    color: #49666e;
    background: #fff;
    border: 1px solid var(--blm-border);
}

.control-hours-note .btn-icon:hover {
    color: var(--blm-deep);
    background: #eef7f8;
}

.quick-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.control-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    color: #173b44;
    background: #fff;
}

.control-filter-menu {
    width: 280px;
    max-height: 320px;
    overflow: auto;
}

.dashboard-period-dropdown .control-filter-toggle {
    min-width: 150px;
}

.dashboard-period-dropdown .control-filter-menu {
    max-height: 340px;
    overflow-y: auto;
}

.control-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    font-size: .88rem;
    cursor: pointer;
}

.control-filter-options {
    max-height: 220px;
    overflow: auto;
}

.control-summary-card strong {
    font-size: 1.32rem;
}

.control-summary-card small {
    color: #64777d;
}

.control-alerts {
    display: grid;
    gap: 8px;
}

.control-alert {
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .9rem;
    border: 1px solid transparent;
}

.control-alert-danger {
    background: #fde8eb;
    border-color: #f5b8c2;
    color: #942233;
}

.control-alert-warning {
    background: #fff7db;
    border-color: #f0d784;
    color: #745700;
}

.control-alert-info {
    background: #eaf6fb;
    border-color: #b7dce9;
    color: #1a5b70;
}

.control-detail-scroll {
    max-height: 58vh;
    overflow: auto;
    padding-right: 4px;
}

.company-detail-group {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #fff;
}

.company-detail-header {
    display: flex;
    position: relative;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 48px 14px 16px;
    background: #eef7f8;
    color: var(--blm-deep);
    font-size: .88rem;
}

.company-detail-header::after {
    position: absolute;
    top: 18px;
    right: 16px;
    margin-left: 0;
}

.company-detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.company-detail-title-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: .98rem;
}

.company-summary-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    width: 100%;
}

.company-summary-title {
    min-width: 126px;
    color: #45636b;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.company-summary-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(112px, 1fr));
    gap: 10px;
    flex: 1 1 360px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.summary-item span {
    color: #5f747a;
    font-size: .77rem;
    font-weight: 700;
}

.summary-item strong {
    color: var(--blm-deep);
    font-size: .95rem;
    line-height: 1.2;
    white-space: nowrap;
}

.summary-item.client-balance-negative strong {
    color: #b42318;
}

.control-detail-table {
    width: 100%;
    margin-bottom: 0;
    table-layout: fixed;
    min-width: 0;
}

.control-detail-actions-toolbar {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.control-detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e8f2f4;
}

.control-detail-table th:nth-child(1),
.control-detail-table td:nth-child(1) {
    width: 9%;
}

.control-detail-table th:nth-child(2),
.control-detail-table td:nth-child(2) {
    width: 25%;
}

.control-detail-table th:nth-child(3),
.control-detail-table td:nth-child(3) {
    width: 9%;
}

.control-detail-table th,
.control-detail-table td {
    padding: 10px 8px;
    vertical-align: middle;
}

.control-detail-table td {
    overflow-wrap: anywhere;
}

.control-detail-table tbody tr {
    height: 156px;
}

.control-detail-table .control-hours-col {
    width: 10%;
    white-space: nowrap;
}

.control-detail-table .control-client-col {
    width: 11%;
    white-space: nowrap;
}

.control-detail-table .control-actions-col {
    width: 23%;
    white-space: nowrap;
}

.control-detail-table .btn-client-view-edit {
    padding: 2px 6px;
    vertical-align: baseline;
}

.control-detail-table .actions-cell {
    min-width: 0;
    box-shadow: -6px 0 10px rgba(255, 255, 255, .85);
}

.control-detail-table .activity-actions-scroll {
    display: grid;
    align-content: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    overflow: visible;
}

.control-detail-table .activity-action-row {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 28px;
}

.control-detail-table .activity-open-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: .875rem;
    color: #12333a;
}

.control-detail-table .activity-open-check .form-check-input {
    border-color: #198754;
    box-shadow: none;
}

.control-detail-table .activity-open-check .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

.control-detail-table .activity-open-check .form-check-input:focus {
    border-color: #198754;
    box-shadow: 0 0 0 .18rem rgba(25, 135, 84, .18);
}

.control-detail-table .activity-hours-badge {
    border: 1px solid #e0a800;
    border-radius: 6px;
    background: #fff3cd;
    padding: 3px 7px;
    color: #5f4700;
    font-weight: 700;
    line-height: 1.2;
}

.control-detail-table .activity-hours-badge:hover,
.control-detail-table .activity-hours-badge:focus {
    background: #ffe8a1;
    color: #4d3900;
}

.control-detail-table .activity-hours-badge-approved {
    border-color: #198754;
    background: #d1e7dd;
    color: #0f5132;
}

.control-detail-table .activity-hours-badge-approved:hover,
.control-detail-table .activity-hours-badge-approved:focus {
    background: #badbcc;
    color: #0f5132;
}

.control-detail-table .activity-action-approved .activity-open-check {
    color: #0f5132;
    font-weight: 700;
}

.control-detail-table .activity-open-check .form-check-input:disabled {
    opacity: 1;
}

.control-detail-table .activity-action-empty {
    justify-content: center;
    color: #667085;
    font-size: .85rem;
}

.activity-time-editor {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
}

.activity-time-fields {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 5px;
    width: auto !important;
    max-width: max-content;
}

.activity-time-input,
.activity-time-fields .activity-time-input.form-control {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    flex: 0 0 56px !important;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.activities-scroll-table .activity-time-column {
    width: 190px;
    text-align: center;
}

.client-project-accordion .summary-item strong {
    white-space: normal;
}

.client-project-accordion .company-detail-header {
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) repeat(6, minmax(104px, 1fr));
    align-items: center;
    gap: 10px;
    padding-right: 48px;
}

.client-project-accordion .company-detail-header::after {
    top: 50%;
    transform: translateY(-50%);
}

.client-project-accordion .company-summary-group,
.client-project-accordion .company-summary-items {
    display: contents;
}

.client-project-accordion .company-detail-title-row {
    gap: 10px;
}

.client-project-accordion .summary-item {
    min-width: 0;
}

.client-project-accordion .summary-item span,
.client-project-accordion .summary-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-detalhamento-acompanhamento .modal-dialog {
    max-width: 95vw;
}

.modal-detalhamento-acompanhamento .modal-content {
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
}

.modal-detalhamento-acompanhamento .modal-header,
.modal-detalhamento-acompanhamento .modal-footer {
    flex: 0 0 auto;
}

.modal-detalhamento-acompanhamento .modal-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 16px;
}

.modal-detalhamento-acompanhamento .client-project-accordion {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.modal-detalhamento-acompanhamento .gestor-detail-toolbar {
    flex: 0 0 auto;
}

.client-detail-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid #d3e4e8;
    border-radius: 8px;
}

.client-detail-table {
    margin-bottom: 0;
    min-width: 980px;
    table-layout: fixed;
}

.client-detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #e8f2f4;
    color: #073d4a;
    font-size: .75rem;
    text-transform: uppercase;
}

.client-detail-table th,
.client-detail-table td {
    padding: 12px 14px;
    overflow-wrap: anywhere;
}

.client-detail-table th:nth-child(1),
.client-detail-table td:nth-child(1) {
    width: 16%;
}

.client-detail-table th:nth-child(2),
.client-detail-table td:nth-child(2) {
    width: 28%;
}

.client-detail-table th:nth-child(3),
.client-detail-table td:nth-child(3) {
    width: 130px;
}

.client-detail-table th:nth-child(4),
.client-detail-table td:nth-child(4),
.client-detail-table th:nth-child(5),
.client-detail-table td:nth-child(5),
.client-detail-table th:nth-child(6),
.client-detail-table td:nth-child(6) {
    width: 118px;
    white-space: nowrap;
}

.client-detail-table th:nth-child(7),
.client-detail-table td:nth-child(7),
.client-detail-table th:nth-child(8),
.client-detail-table td:nth-child(8) {
    width: 96px;
    white-space: nowrap;
}

.client-project-detail-modal {
    border-color: #16835f;
}

.client-project-detail-modal .modal-header,
.client-project-detail-modal .modal-footer {
    border-color: color-mix(in srgb, #16835f, #fff 68%);
}

.client-project-activity-scroll {
    flex: 1 1 auto;
    min-height: 220px;
    overflow: auto;
    border: 1px solid color-mix(in srgb, #16835f, #fff 58%);
    border-radius: 8px;
}

.client-project-activity-table {
    min-width: 920px;
}

.client-project-activity-table thead th {
    background: #e8f6f1;
}

.client-project-activity-table th:nth-child(1),
.client-project-activity-table td:nth-child(1) {
    width: 112px;
}

.client-project-activity-table th:nth-child(2),
.client-project-activity-table td:nth-child(2) {
    width: 130px;
}

.client-project-activity-table th:nth-child(3),
.client-project-activity-table td:nth-child(3) {
    width: 150px;
}

.client-project-activity-table th:nth-child(5),
.client-project-activity-table td:nth-child(5) {
    width: 90px;
}

.client-activity-table-wrapper {
    max-height: min(52vh, 420px);
    overflow-y: auto;
    overflow-x: auto;
}

.client-activity-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #e8f2f4;
}

.modal-detalhamento-acompanhamento .modal-footer {
    justify-content: space-between;
}

.client-project-accordion table th:nth-child(1),
.client-project-accordion table td:nth-child(1) {
    width: 120px;
}

.client-project-accordion table th:nth-child(2),
.client-project-accordion table td:nth-child(2) {
    min-width: 280px;
}

.client-project-accordion table th:nth-child(3),
.client-project-accordion table td:nth-child(3) {
    width: 150px;
}

.client-project-accordion table th:nth-child(4),
.client-project-accordion table td:nth-child(4) {
    width: 170px;
}

@media (max-width: 991.98px) {
    .client-dashboard-workspace {
        gap: 18px;
        padding: 16px;
    }

    .client-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .control-filter-strip {
        grid-template-columns: 1fr;
    }

    .control-company-button,
    .control-department-button {
        grid-template-columns: repeat(3, minmax(72px, 1fr)) 28px;
        gap: 6px 8px;
    }

    .control-company-button::after,
    .control-department-button::after {
        grid-column: 4;
        grid-row: 1 / span 2;
    }

    .control-company-button .control-company-title,
    .control-department-button .control-department-title {
        grid-column: 1 / 4;
    }

    .control-project-header {
        flex-direction: column;
        align-items: stretch;
    }

    .control-project-metrics {
        justify-content: flex-start;
        text-align: left;
    }

    .client-project-accordion .company-detail-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-right: 44px;
    }

    .client-project-accordion .company-detail-header::after {
        top: 18px;
        transform: none;
    }

    .client-project-accordion .company-detail-title-row,
    .client-project-accordion .company-summary-group {
        display: flex;
    }

    .client-project-accordion .company-summary-items {
        display: grid;
    }

    .company-summary-items {
        grid-template-columns: repeat(2, minmax(112px, 1fr));
        max-width: none;
        flex: 1 1 260px;
    }

}

@media (max-width: 575.98px) {
    .client-status-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 479.98px) {
    .projects-modal-toolbar,
    .projects-modal-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .projects-status-filter,
    .projects-search {
        width: 100%;
        flex-basis: auto;
    }
}

@media (max-width: 575.98px) {
    .modal-detalhamento-acompanhamento .modal-content {
        height: 100vh;
        max-height: 100vh;
    }

    .modal-detalhamento-acompanhamento .modal-body {
        padding: 12px;
    }

    .modal-detalhamento-acompanhamento .modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .client-activity-table-wrapper {
        max-height: 54vh;
    }

    .company-detail-header {
        padding: 12px 44px 12px 12px;
    }

    .company-summary-title {
        min-width: 100%;
    }

    .company-summary-items {
        grid-template-columns: 1fr;
        flex-basis: 100%;
    }

}

.control-mobile-card {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fff;
}

.user-departments-box {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.user-departments-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.user-departments-search {
    width: min(320px, 100%);
}

.user-departments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px 14px;
    max-height: 220px;
    overflow: auto;
    padding: 2px 4px 2px 0;
}

.user-department-option {
    min-height: 26px;
    margin: 0;
}

.control-detail-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-detail-accordion .accordion-item {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    overflow: hidden;
}

.control-detail-accordion .accordion-button {
    box-shadow: none;
}

.control-detail-accordion .accordion-button:not(.collapsed) {
    background: #eef7f8;
    color: var(--blm-deep);
}

.control-detail-accordion .accordion-body {
    padding: 0;
}

.client-balance-negative {
    color: #b42318;
    font-weight: 800;
}

.client-balance-alert {
    flex-basis: 100%;
    color: #b42318;
    font-size: .78rem;
    font-weight: 700;
}

.client-view-readonly {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    padding: 10px 12px;
    background: #f8fbfc;
}

.client-view-readonly small {
    display: block;
    color: #667085;
    font-weight: 700;
}

.client-view-time-input {
    max-width: 160px;
}

.client-view-preview {
    border: 1px solid #b7dce9;
    border-radius: 8px;
    padding: 10px 12px;
    background: #eef7f8;
    color: var(--blm-deep);
}

.mobile-detail-list {
    display: grid;
    gap: 10px;
}

.assignment-detail-body {
    max-height: calc(100vh - 170px);
    overflow: auto;
}

.assignment-summary-card,
.assignment-detail-section {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
}

.assignment-summary-card h6,
.assignment-detail-section h6 {
    color: var(--blm-deep);
    font-weight: 800;
    margin-bottom: 10px;
}

.assignment-summary-compact {
    padding: 10px 12px;
}

.assignment-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 14px;
}

.assignment-summary-grid small {
    display: block;
    color: #60737a;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.assignment-summary-grid strong {
    display: block;
    color: var(--blm-ink);
    font-size: .92rem;
    line-height: 1.25;
}

.assignment-detail-table {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
}

.activities-scroll-table {
    max-height: min(52vh, 430px);
}

.activities-scroll-table table {
    min-width: 720px;
}

.assignment-detail-table table {
    margin-bottom: 0;
}

.assignment-detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e8f2f4;
    vertical-align: middle;
}

.assignment-detail-table td {
    vertical-align: middle;
}

.activity-text {
    white-space: normal;
    min-width: 220px;
}

.atividades-mobile-cards {
    display: none;
}

.atividades-desktop-table {
    display: block;
}

/* Central de Ajuda */
.help-page {
    display: grid;
    gap: 18px;
}

.help-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #eef8f7 100%);
}

.help-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blm-primary-dark);
    font-weight: 800;
    margin-bottom: 8px;
}

.help-hero h1 {
    margin: 0 0 8px;
    color: var(--blm-deep);
    font-size: clamp(1.55rem, 2vw, 2.15rem);
    font-weight: 800;
}

.help-hero p {
    margin: 0;
    max-width: 720px;
    color: #526970;
}

.help-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    border: 1px solid rgba(0, 110, 124, .2);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--blm-primary-dark);
    background: #fff;
    font-weight: 700;
}

.help-manual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.help-manual-card {
    min-height: 190px;
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #fff;
    padding: 20px;
    text-align: left;
    display: grid;
    align-content: start;
    gap: 10px;
    box-shadow: 0 18px 38px rgba(0, 54, 64, .08);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.help-manual-card:hover,
.help-manual-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--blm-primary);
    box-shadow: 0 20px 44px rgba(0, 110, 124, .15);
}

.help-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eaf7f2;
    color: var(--blm-primary-dark);
    font-size: 1.35rem;
}

.help-manual-card strong {
    color: var(--blm-deep);
    font-size: 1.2rem;
}

.help-manual-card span:not(.help-card-icon) {
    color: #526970;
}

.help-manual-card em {
    color: var(--blm-primary-dark);
    font-style: normal;
    font-weight: 800;
}

.help-workspace {
    padding: 18px;
}

.help-workspace-header,
.help-nav-actions,
.help-progress-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.help-manual-title {
    margin-left: 12px;
    color: var(--blm-deep);
    font-weight: 800;
}

.help-progress-wrap {
    margin: 16px 0;
}

.help-progress-text {
    color: #526970;
    font-weight: 700;
    white-space: nowrap;
}

.help-progress {
    flex: 1;
    height: 8px;
    background: #edf4f5;
}

.help-progress .progress-bar {
    background: var(--blm-primary);
}

.help-step-layout {
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    gap: 16px;
}

.help-index {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    background: #f8fbfb;
    max-height: 640px;
    overflow: auto;
    padding: 8px;
}

.help-index-item {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    padding: 10px;
    text-align: left;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 2px 8px;
    color: var(--blm-ink);
}

.help-index-item span {
    grid-row: span 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f2f4;
    color: var(--blm-primary-dark);
    font-size: .76rem;
    font-weight: 800;
}

.help-index-item strong {
    font-size: .9rem;
    line-height: 1.2;
}

.help-index-item small {
    color: #64777d;
}

.help-index-item.active,
.help-index-item:hover {
    background: #eaf7f2;
}

.help-step-panel {
    border: 1px solid var(--blm-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.help-step-copy {
    padding: 18px 18px 14px;
}

.help-step-module {
    color: var(--blm-primary-dark);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.help-step-copy h2 {
    margin: 5px 0 8px;
    color: var(--blm-deep);
    font-size: 1.35rem;
    font-weight: 800;
}

.help-step-copy p {
    margin: 0 0 12px;
    color: #526970;
}

.help-highlight-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 7px 11px;
    background: #dff4dc;
    color: #127239;
    font-weight: 800;
    font-size: .85rem;
}

.help-screenshot-button {
    display: block;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--blm-border);
    background: #f7fbfb;
    padding: 12px;
    text-align: center;
    color: var(--blm-primary-dark);
    font-weight: 800;
}

.help-screenshot {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 8px;
}

.help-nav-actions {
    margin-top: 16px;
}

.help-expanded-image {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    background: #fff;
}

.help-image-dialog .modal-body {
    background: #f7fbfb;
}

.help-animate {
    animation: helpFade .2s ease;
}

@keyframes helpFade {
    from { opacity: .75; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .help-hero,
    .help-workspace-header,
    .help-nav-actions,
    .help-progress-wrap {
        align-items: stretch;
        flex-direction: column;
    }

    .help-manual-grid,
    .help-step-layout {
        grid-template-columns: 1fr;
    }

    .help-index {
        max-height: 260px;
    }

    .help-hero-badge {
        justify-content: center;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .help-manual-card,
    .help-animate {
        animation: none;
        transition: none;
    }
}
.gestor-projects-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.gestor-projects-toolbar h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.gestor-project-search {
    width: min(460px, 100%);
}

.gestor-projects-list {
    display: grid;
    gap: 14px;
}

.gestor-project-group {
    display: grid;
    gap: 14px;
}

.gestor-project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6eef0;
}

.gestor-project-context {
    display: block;
    color: #607780;
    font-size: .82rem;
    font-weight: 700;
}

.gestor-project-header h2 {
    margin: 3px 0;
    color: #092f38;
    font-size: 1.08rem;
    font-weight: 800;
}

.gestor-project-total {
    display: grid;
    justify-items: end;
    gap: 3px;
    min-width: 150px;
    color: #50666e;
    font-size: .78rem;
}

.gestor-project-total strong {
    color: #0d6f7d;
    font-size: 1.35rem;
    line-height: 1;
}

.gestor-project-activities {
    display: grid;
    gap: 8px;
}

.gestor-project-activity {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    background: #f7fafb;
    border: 1px solid #e5edef;
    border-radius: 8px;
}

.gestor-project-activity-main {
    display: grid;
    gap: 3px;
}

.gestor-project-activity-main strong {
    color: #15363f;
    font-size: .92rem;
}

.gestor-project-activity-main span,
.gestor-project-activity-empty {
    color: #607780;
    font-size: .82rem;
}

.gestor-project-activity-meta {
    display: grid;
    justify-items: end;
    gap: 5px;
    min-width: 96px;
}

.gestor-project-activity-meta strong {
    color: #15363f;
}

@media (max-width: 767.98px) {
    .gestor-projects-toolbar,
    .gestor-project-header,
    .gestor-project-activity {
        flex-direction: column;
        align-items: stretch;
    }

    .gestor-project-total,
    .gestor-project-activity-meta {
        justify-items: start;
    }
}
