/* DMB FinCore - Unidades Operacionais */
.unidades-page .module-header { align-items: center; gap: 1rem; }
.unidades-page .module-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }

.unidades-page .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.unidades-page .summary-card { min-height: 104px; }
.unidades-page .summary-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.unidades-page .summary-content { flex: 1; text-align: center; }
.unidades-page .summary-content strong { margin-top: .45rem; font-size: 1.75rem; }

.unidades-page .units-filter-card { grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto; }
.unidades-page .filter-action { display: flex; align-items: flex-end; }
.unidades-page .filter-action .btn { width: 100%; min-height: 3.5rem; }

.unidades-page .table-card,
.unidades-page .data-table,
.unidades-page .data-table tbody,
.unidades-page .data-table tr,
.unidades-page .data-table td { overflow: visible; }
.unidades-page .table-card { margin-top: .25rem; }
.unidades-page .data-table { min-width: 1080px; }
.unidades-page .data-table th:first-child,
.unidades-page .data-table td:first-child { width: 23%; }
.unidades-page .data-table th:nth-child(6),
.unidades-page .data-table td:nth-child(6) { width: 8rem; text-align: center; }
.unidades-page .data-table th:last-child,
.unidades-page .data-table td:last-child { width: 6rem; text-align: center; }
.unidades-page .data-table td { vertical-align: middle; }

.unidades-page .entity-icon { display: flex !important; align-items: center; justify-content: center; padding: 0; text-align: center; line-height: 1; }
.unidades-page .entity-title { color: var(--fincore-navy) !important; font-size: 1.1rem !important; font-weight: 900 !important; line-height: 1.2 !important; }
.unidades-page .entity-subtitle { font-size: .78rem; }
.unidades-page .unit-type-text { display: inline !important; margin: 0 !important; color: var(--fincore-text) !important; font-size: .88rem !important; font-weight: 700; line-height: 1.35; }

.unidades-page .unit-status-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; padding: .38rem .75rem; border-radius: 999px; font-size: .92rem; font-weight: 800; line-height: 1; pointer-events: none; user-select: none; }
.unidades-page .unit-status-badge.active { color: #047857; background: #d1fae5; }
.unidades-page .unit-status-badge.inactive { color: #b91c1c; background: #fee2e2; }

.unidades-page .actions-cell { position: relative; z-index: 1; width: 96px; min-width: 96px; overflow: visible; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; text-align: center; }
.unidades-page .unit-actions-menu { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; }
.unidades-page .kebab-button { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 42px; padding: 0 0 .15rem; border: 1px solid #bfdbfe; border-radius: 14px; background: #fff; color: #1d4ed8; box-shadow: none; font-size: 1.6rem; font-weight: 900; line-height: 1; cursor: pointer; }
.unidades-page .kebab-button:hover,
.unidades-page .kebab-button:focus-visible { border-color: #1d4ed8; background: #eff6ff; }
.unidades-page .kebab-menu { position: absolute; top: calc(100% + .45rem); left: 50%; z-index: 130; min-width: 168px; padding: .45rem; transform: translateX(-50%); border: 1px solid #dbeafe; border-radius: 16px; background: #fff; box-shadow: 0 20px 48px rgba(15, 23, 42, .18); }
.unidades-page .kebab-menu button { width: 100%; padding: .75rem .9rem; border: 0; border-radius: 12px; background: transparent; color: var(--fincore-navy); font-size: .96rem; font-weight: 800; text-align: center; cursor: pointer; }
.unidades-page .kebab-menu button:hover { color: #1d4ed8; background: #eff6ff; }
.unidades-page .kebab-menu button.danger { color: var(--fincore-red); }
.unidades-page .kebab-menu button.success { color: var(--fincore-green); }
.unidades-page .actions-backdrop { position: fixed; inset: 0; z-index: 50; border: 0; background: transparent; cursor: default; }
.unidades-page .data-table tbody tr { position: relative; z-index: 0; }
.unidades-page .data-table tbody tr.actions-row-open { z-index: 110; }
.unidades-page .actions-cell.is-open,
.unidades-page .actions-cell.is-open .unit-actions-menu { z-index: 120; }

.unidades-page .unit-modal-overlay { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; overflow-y: auto; background: rgba(15, 23, 42, .64); backdrop-filter: blur(4px); }
.unidades-page .unit-modal { width: min(1180px, 96vw); max-height: calc(100vh - 3rem); margin: auto; padding: 1.5rem; overflow-y: auto; box-shadow: 0 28px 80px rgba(15, 23, 42, .34); }
.unidades-page .unit-modal .form-section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.unidades-page .unit-modal-feedback { margin: 0 0 1.25rem; }
.unidades-page .unit-modal-close { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 1px solid #bfdbfe; border-radius: 13px; color: #1d4ed8; background: #eff6ff; font-size: 1.65rem; font-weight: 800; line-height: 1; cursor: pointer; }
.unidades-page .unit-modal-close:hover { border-color: #1d4ed8; background: #dbeafe; }

@media (max-width: 1100px) {
    .unidades-page .units-filter-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .unidades-page .filter-action { grid-column: span 2; }
}

@media (max-width: 760px) {
    .unidades-page .module-header { align-items: stretch; flex-direction: column; }
    .unidades-page .module-header-actions,
    .unidades-page .module-header-actions .btn { width: 100%; }
    .unidades-page .summary-grid,
    .unidades-page .units-filter-card,
    .unidades-page .form-grid-two { grid-template-columns: 1fr; }
    .unidades-page .filter-action { grid-column: auto; }
    .unidades-page .unit-modal-overlay { align-items: flex-start; padding: .5rem; }
    .unidades-page .unit-modal { max-height: calc(100vh - 1rem); padding: 1rem; }
    .unidades-page .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .unidades-page .form-actions button { width: 100%; }
    .unidades-page .actions-cell { width: 72px; min-width: 72px; }
}
