:root {
    --erp-sidebar-width: 17.5rem;
    --erp-sidebar-collapsed-width: 5.25rem;
    --erp-sidebar-bg: #0f172a;
    --erp-sidebar-hover: rgba(255, 255, 255, 0.08);
    --erp-sidebar-active: rgba(13, 110, 253, 0.28);
    --erp-border: var(--bs-border-color);
    --erp-border-strong: #adb5bd;
    --erp-muted: var(--bs-secondary-color);
    --erp-accent: var(--bs-primary);
    --erp-radius: 0.75rem;
}

html {
    font-size: 90%;
}

body {
    background-color: var(--bs-tertiary-bg);
}

a {
    text-decoration: none;
}

.errorlist {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    color: var(--bs-danger);
    font-size: 0.875rem;
}

.erp-shell {
    min-height: 100vh;
    display: flex;
    background: var(--bs-tertiary-bg);
}

.erp-sidebar {
    width: var(--erp-sidebar-width);
    flex: 0 0 var(--erp-sidebar-width);
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    background: var(--erp-sidebar-bg);
    color: rgba(255, 255, 255, 0.92);
    padding: 1.25rem 1rem;
    transition: width 0.24s ease, flex-basis 0.24s ease, padding 0.24s ease;
}

.erp-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: #fff;
    min-width: 0;
}

.erp-brand-mark {
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.erp-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.erp-brand-text,
.erp-menu-text {
    min-width: 0;
    max-width: 12rem;
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.18s ease, transform 0.18s ease, max-width 0.24s ease;
}

.erp-sidebar-toggle {
    width: 2.25rem;
    height: 2.25rem;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.86);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.erp-sidebar-toggle:hover,
.erp-sidebar-toggle:focus-visible {
    background: var(--erp-sidebar-hover);
    color: #fff;
}

.erp-sidebar-nav {
    display: grid;
    gap: 1rem;
}

.erp-menu-group {
    display: grid;
    gap: 0.5rem;
}

.erp-menu-title {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    text-align: left;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, padding 0.24s ease;
}

.erp-menu-title:hover,
.erp-menu-title:focus-visible {
    background: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    color: #fff;
}

.erp-menu-title-code {
    display: none;
}

.erp-menu-title-text {
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-menu-title .bi-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.erp-menu-group.is-open .erp-menu-title .bi-chevron-down {
    transform: rotate(180deg);
}

.erp-menu-list {
    display: grid;
    gap: 0.25rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.24s ease, opacity 0.18s ease;
}

/* O grupo ativo ou aberto pelo usuario revela seus links. */
.erp-menu-group.is-open .erp-menu-list {
    max-height: 32rem;
    opacity: 1;
}

.erp-menu-link,
.erp-menu-empty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    min-width: 0;
    transition: background-color 0.2s ease, color 0.2s ease, padding 0.24s ease, gap 0.24s ease;
}

.erp-menu-link:hover,
.erp-menu-link:focus {
    background: var(--erp-sidebar-hover);
    color: #fff;
}

.erp-menu-link.is-active {
    background: var(--erp-sidebar-active);
    color: #fff;
}

.erp-menu-code {
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
}

.erp-row-danger {
    background: rgba(220, 53, 69, 0.08);
}

.erp-row-warning {
    background: rgba(255, 193, 7, 0.1);
}

.erp-row-today {
    background: rgba(13, 110, 253, 0.08);
}

.erp-row-soon {
    background: rgba(25, 135, 84, 0.08);
}

.erp-due-row td {
    padding: 0.55rem 0.75rem;
    color: #fff;
    font-weight: 600;
    border-top: 2px solid rgba(0, 0, 0, 0.25);
}

.erp-due-row:hover td {
    color: #fff;
}

.erp-due-row strong {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.2rem 0.65rem;
    margin-inline: 0.35rem;
    border-radius: 0.4rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

.erp-due-separator {
    margin-inline: 0.65rem;
    opacity: 0.85;
}

.erp-due-row-danger,
.erp-due-row-warning {
    background: #dc3545;
}

.erp-due-row-today {
    background: #0d6efd;
}

.erp-due-row-soon {
    background: #198754;
}

.erp-due-row-neutral {
    background: #495057;
}

/* Sidebar recolhido: grupos aparecem compactos e mantem seus itens agrupados. */
.erp-shell.is-sidebar-collapsed .erp-sidebar {
    width: var(--erp-sidebar-collapsed-width);
    flex-basis: var(--erp-sidebar-collapsed-width);
    padding-inline: 0.75rem;
}

.erp-shell.is-sidebar-collapsed .erp-brand {
    justify-content: center;
}

.erp-shell.is-sidebar-collapsed .erp-brand-mark {
    display: none;
}

.erp-shell.is-sidebar-collapsed .erp-brand-text,
.erp-shell.is-sidebar-collapsed .erp-menu-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(-0.35rem);
}

.erp-shell.is-sidebar-collapsed .erp-sidebar-toggle {
    margin-left: 0;
}

.erp-shell.is-sidebar-collapsed .erp-sidebar-toggle .bi {
    transform: rotate(180deg);
}

.erp-shell.is-sidebar-collapsed .erp-menu-title {
    position: relative;
    width: 100%;
    height: 2.5rem;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.erp-shell.is-sidebar-collapsed .erp-menu-title-code {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
}

.erp-shell.is-sidebar-collapsed .erp-menu-group.is-open .erp-menu-title-code {
    background: var(--erp-sidebar-active);
    color: #fff;
}

.erp-shell.is-sidebar-collapsed .erp-menu-title-text,
.erp-shell.is-sidebar-collapsed .erp-menu-title .bi-chevron-down {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.erp-shell.is-sidebar-collapsed .erp-menu-list {
    gap: 0.25rem;
}

.erp-shell.is-sidebar-collapsed .erp-sidebar-nav {
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.erp-shell.is-sidebar-collapsed .erp-menu-link,
.erp-shell.is-sidebar-collapsed .erp-menu-empty {
    justify-content: center;
    gap: 0;
    padding-inline: 0.5rem;
}

.erp-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.erp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem 1.5rem;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(15, 23, 42, 0.04);
}

.erp-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.erp-topbar-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.erp-topbar-kicker {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color);
}

.erp-userbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.erp-user-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-body-bg);
}

.erp-user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 700;
}

.erp-user-meta {
    display: none;
}

.erp-content {
    flex: 1 1 auto;
    padding: 1.5rem;
}

.erp-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.erp-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.erp-breadcrumb-separator {
    color: var(--bs-tertiary-color);
}

.erp-page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.erp-page-heading h1 {
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

.erp-page-heading p {
    margin-bottom: 0;
    color: var(--bs-secondary-color);
}

.erp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.erp-panel,
.erp-table-panel,
.erp-stat-card,
.erp-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(15, 23, 42, 0.06);
}

.erp-panel,
.erp-stat-card,
.erp-card {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.erp-table-panel {
    overflow: hidden;
}

.erp-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.erp-section-title a {
    font-weight: 500;
}

.erp-section-title h2 {
    margin: 0;
    font-size: 1.1rem;
}

.erp-section-title span {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.erp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.erp-stat-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.erp-stat-card:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, 0.18);
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.08);
}

.erp-stat-label,
.erp-card span,
.erp-module-body span,
.erp-mini-stat span,
.erp-activity-body > span,
.erp-activity-body small {
    color: var(--bs-secondary-color);
}

.erp-stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.erp-stat-icon,
.erp-activity-icon,
.erp-module-icon,
.erp-quick-link-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-size: 1.05rem;
}

.erp-stat-link {
    color: var(--bs-tertiary-color);
    font-size: 0.95rem;
}

.erp-stat-body {
    display: grid;
    gap: 0.35rem;
}

.erp-stat-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.erp-stat-card strong {
    display: block;
    margin-top: 0;
    font-size: 1.85rem;
    line-height: 1.1;
}

.erp-stat-card small,
.erp-card small {
    display: block;
    margin-top: 0;
    color: var(--bs-secondary-color);
}

.erp-dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(20rem, 0.95fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.erp-dashboard-main,
.erp-dashboard-side {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.erp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
    gap: 1rem;
}

.erp-card {
    display: block;
    color: inherit;
}

.erp-card:hover {
    color: inherit;
    border-color: rgba(13, 110, 253, 0.2);
}

.erp-welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, var(--bs-primary), #0b5ed7);
    color: #fff;
}

.erp-dashboard-hero {
    align-items: stretch;
    gap: 1.5rem;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, #0d6efd 0%, #0b5ed7 45%, #0f172a 100%);
}

.erp-welcome-main {
    display: flex;
    gap: 0.85rem;
    width: stretch;
}

.erp-welcome-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.78;
}

.erp-welcome h2,
.erp-welcome p {
    margin: 0;
    color: inherit;
}

.erp-quick-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(13.75rem, 1fr));
    gap: 0.75rem;
    min-width: min(100%, 32.5rem);
}

.erp-quick-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(6px);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.erp-quick-link:hover {
    color: #fff;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.erp-quick-link-empty {
    opacity: 0.88;
}

.erp-quick-link .erp-quick-link-icon {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    flex: 0 0 auto;
}

.erp-quick-link-body {
    display: grid;
    gap: 0.2rem;
}

.erp-quick-link-body strong,
.erp-module-body strong,
.erp-mini-stat strong,
.erp-activity-body strong {
    color: inherit;
}

.erp-quick-link-body small {
    color: rgba(255, 255, 255, 0.82);
}

.erp-badge-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    align-items: end;
    gap: 0.5rem;
}

.erp-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.875rem;
}

.erp-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14.375rem, 1fr));
    gap: 0.9rem;
}

.erp-module-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.7), rgba(255, 255, 255, 1));
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.erp-module-card:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, 0.18);
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.08);
}

.erp-module-body {
    display: grid;
    gap: 0.3rem;
}

.erp-module-arrow {
    color: var(--bs-tertiary-color);
}

.erp-mini-stats {
    display: grid;
    gap: 0.75rem;
}

.erp-mini-stat {
    padding: 0.95rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.9rem;
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.72), rgba(255, 255, 255, 1));
}

.erp-mini-stat small {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.erp-mini-stat strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 1.2rem;
}

.erp-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.erp-activity-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: start;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.erp-activity-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.erp-activity-icon-soft {
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
}

.erp-activity-body {
    display: grid;
    gap: 0.2rem;
}

.erp-activity-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.erp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.erp-list-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--bs-border-color);
}

.erp-list-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.erp-empty-state {
    color: var(--bs-secondary-color);
}

.erp-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)) auto;
    gap: 0.75rem;
    align-items: end;
}

.erp-form {
    display: grid;
    gap: 1.25rem;
}

.erp-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.erp-form-group {
    display: grid;
    gap: 0.35rem;
}

.erp-form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.erp-input,
.erp-form-group input:not([type="checkbox"]):not([type="radio"]),
.erp-form-group select,
.erp-form-group textarea {
    width: 100%;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    background: var(--bs-body-bg);
}

.erp-form-group input[type="file"] {
    padding: 0.375rem 0.75rem;
}

.erp-form-group small {
    color: var(--bs-secondary-color);
}

.erp-form-group .errorlist {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--bs-danger);
    font-size: 0.875rem;
}

.erp-form-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.erp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.erp-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.erp-btn-primary {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.erp-btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    color: #fff;
}

.erp-btn-light {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

.erp-btn-light:hover {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.erp-btn-block {
    width: 100%;
}

.erp-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.erp-table thead th {
    padding: 0.875rem 1rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--bs-border-color);
}

.erp-table td {
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--bs-border-color);
    vertical-align: top;
}

.erp-table tbody tr:hover {
    background: rgba(13, 110, 253, 0.03);
}

.erp-finance-totalbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--erp-radius);
    box-shadow: var(--erp-shadow-sm);
    font-size: 1.35rem;
    color: #0f172a;
}

.erp-finance-totalbar strong {
    font-weight: 600;
}

.erp-finance-totalbar strong:nth-child(2) {
    text-align: center;
}

.erp-finance-totalbar strong:nth-child(3) {
    text-align: right;
}

.erp-finance-totalbar span[class^="erp-total-"] {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.erp-total-danger {
    color: #dc3545;
}

.erp-total-primary {
    color: #0d6efd;
}

.erp-total-success {
    color: #198754;
}

.erp-paste-zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    margin-top: 0.65rem;
    padding: 1rem;
    border: 1px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #334155;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.erp-paste-zone:hover,
.erp-paste-zone:focus {
    border-color: var(--erp-primary);
    background: #eef5ff;
}

.erp-paste-zone i {
    font-size: 1.6rem;
    color: var(--erp-primary);
}

.erp-paste-zone span {
    font-weight: 700;
}

.erp-paste-zone small {
    color: #64748b;
}

.erp-proof-preview {
    display: grid;
    gap: 0.5rem;
    justify-items: center;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: #fff;
}

.erp-proof-preview img {
    max-width: 100%;
    max-height: 13rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.4rem;
    object-fit: contain;
}

.erp-proof-preview span {
    font-weight: 600;
    color: #334155;
    overflow-wrap: anywhere;
}

.erp-finance-table-wrap {
    overflow-x: visible;
}

.erp-finance-table {
    width: 100%;
    table-layout: fixed;
}

.erp-finance-table th,
.erp-finance-table td {
    padding: 0.55rem 0.75rem !important;
    padding-inline: 0.5rem;
    overflow-wrap: anywhere;
}

.erp-finance-table .erp-col-select {
    width: 2.5%;
}

.erp-finance-table .erp-col-descricao {
    width: 24%;
}

.erp-finance-table .erp-col-parcelas {
    width: 6%;
}

.erp-finance-table .erp-col-valor {
    width: 10%;
}

.erp-finance-table .erp-col-chave {
    width: 15.5%;
}

.erp-finance-table .erp-col-usuario {
    width: 5.5%;
}

.erp-finance-table .erp-col-tipo,
.erp-finance-table .erp-col-regiao {
    width: 7.5%;
}

.erp-finance-table .erp-col-anexos {
    width: 6%;
}

.erp-finance-table .erp-col-acao {
    width: 15%;
}

.erp-finance-table .input-group {
    min-width: 0;
    flex-wrap: nowrap;
}

.erp-finance-table .form-control {
    min-width: 0;
    padding-inline: 0.45rem;
    text-overflow: ellipsis;
}

.erp-table tbody tr.erp-due-row-danger:hover,
.erp-due-row-danger {
    background: #dc3545;
}

.erp-table tbody tr.erp-due-row-warning:hover,
.erp-due-row-warning {
    background: #dc3545;
}

.erp-table tbody tr.erp-due-row-today:hover,
.erp-due-row-today {
    background: #0d6efd;
}

.erp-table tbody tr.erp-due-row-soon:hover,
.erp-due-row-soon {
    background: #198754;
}

.erp-table tbody tr.erp-due-row-neutral:hover,
.erp-due-row-neutral {
    background: #495057;
}

.erp-finance-table .erp-actions {
    min-width: 0;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.erp-finance-table .erp-actions .erp-btn {
    min-height: 2rem;
    padding: 0.35rem 0.5rem;
}

@media (max-width: 1400px) {
    .erp-finance-table th,
    .erp-finance-table td {
        padding-inline: 0.4rem;
    }

    .erp-finance-table .erp-col-descricao {
        width: 21%;
    }

    .erp-finance-table .erp-col-chave {
        width: 14%;
    }

    .erp-finance-table .erp-col-usuario {
        width: 6.5rem;
    }

    .erp-finance-table .erp-col-tipo,
    .erp-finance-table .erp-col-regiao {
        width: 6rem;
    }

    .erp-finance-table .erp-col-acao {
        width: 8.5rem;
    }
}

@media (max-width: 1100px) {
    .erp-finance-table th:nth-child(6),
    .erp-finance-table td:nth-child(6),
    .erp-finance-table th:nth-child(7),
    .erp-finance-table td:nth-child(7) {
        display: none;
    }
}

@media (max-width: 900px) {
    .erp-finance-totalbar {
        grid-template-columns: 1fr;
        font-size: 1.05rem;
    }

    .erp-finance-totalbar strong,
    .erp-finance-totalbar strong:nth-child(2),
    .erp-finance-totalbar strong:nth-child(3) {
        text-align: left;
    }

    .erp-finance-table th:nth-child(5),
    .erp-finance-table td:nth-child(5),
    .erp-finance-table th:nth-child(8),
    .erp-finance-table td:nth-child(8),
    .erp-finance-table th:nth-child(9),
    .erp-finance-table td:nth-child(9) {
        display: none;
    }

    .erp-finance-table .erp-col-descricao {
        width: 36%;
    }

    .erp-finance-table .erp-col-parcelas {
        width: 4.75rem;
    }

    .erp-finance-table .erp-col-valor {
        width: 7rem;
    }

    .erp-finance-table .erp-col-acao {
        width: 7.25rem;
    }

    .erp-finance-table .erp-actions .erp-btn {
        width: 100%;
        justify-content: center;
    }
}

.erp-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.erp-definition-list {
    margin: 0;
}

.erp-definition-list div {
    display: grid;
    grid-template-columns: 11.25rem 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--bs-border-color);
}

.erp-definition-list div:first-child {
    border-top: 0;
}

.erp-definition-list dt {
    color: var(--bs-secondary-color);
    font-weight: 600;
}

.erp-definition-list dd {
    margin: 0;
}

.erp-code-block {
    margin: 0;
    padding: 1rem;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 0.75rem;
    overflow: auto;
}

.erp-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.status-ativo,
.status-entrada,
.status-resolvido,
.status-concluido,
.status-pago,
.status-paga,
.status-recebido,
.status-ok,
.prioridade-baixa {
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
}

.status-manutencao,
.status-em_andamento,
.status-pendente,
.status-aberto,
.status-aberta,
.status-parcial,
.status-em_uso,
.status-em_analise,
.status-aguardando_informacao,
.prioridade-normal {
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
}

.status-inativo,
.status-saida,
.status-cancelado,
.status-cancelada,
.status-reprovado,
.status-atrasado,
.status-urgente,
.prioridade-urgente {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
}

.status-revisao,
.status-ajuste,
.status-info,
.status-isento,
.status-nao_aplica,
.status-em_execucao,
.prioridade-alta {
    background: var(--bs-info-bg-subtle);
    color: var(--bs-info-text-emphasis);
}

.erp-messages {
    margin-bottom: 1rem;
}

.alert-error {
    color: var(--bs-danger-text-emphasis);
    background-color: var(--bs-danger-bg-subtle);
    border-color: var(--bs-danger-border-subtle);
}

.alert-error .alert-link {
    color: var(--bs-danger-text-emphasis);
}

.alert .bi {
    margin-right: 0.5rem;
}

.erp-public-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(13, 110, 253, 0.08), rgba(248, 249, 250, 1));
}

.erp-public-shell {
    width: 100%;
    max-width: 32.5rem;
}

.erp-login-card {
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.08);
}

.erp-login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.erp-login-brand h1 {
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.erp-login-brand p {
    margin-bottom: 0;
    color: var(--bs-secondary-color);
}

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

    .erp-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .erp-shell {
        display: block;
    }

    .erp-sidebar {
        width: 100%;
        flex-basis: auto;
        min-height: auto;
        position: static;
    }

    .erp-shell.is-sidebar-collapsed .erp-sidebar {
        width: 100%;
        flex-basis: auto;
    }

    .erp-shell.is-sidebar-collapsed .erp-brand {
        justify-content: flex-start;
    }

    .erp-shell.is-sidebar-collapsed .erp-brand-mark {
        display: inline-flex;
    }

    .erp-shell.is-sidebar-collapsed .erp-sidebar-toggle {
        margin-left: auto;
    }

    .erp-shell.is-sidebar-collapsed .erp-sidebar-nav {
        grid-template-columns: repeat(auto-fit, minmax(3rem, 1fr));
    }

    .erp-dashboard-layout {
        grid-template-columns: 1fr;
    }

    .erp-topbar,
    .erp-userbox {
        flex-wrap: wrap;
    }

    .erp-quick-links {
        grid-template-columns: 1fr;
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .erp-content,
    .erp-topbar,
    .erp-footer {
        padding-inline: 1rem;
    }

    .erp-form-grid,
    .erp-filter-form,
    .erp-definition-list div {
        grid-template-columns: 1fr;
    }

    .erp-page-heading,
    .erp-footer,
    .erp-list-item,
    .erp-pagination,
    .erp-welcome {
        flex-direction: column;
        align-items: stretch;
    }

    .erp-module-card,
    .erp-activity-item {
        grid-template-columns: 1fr;
    }
}
