/* Nexum — tema Kaju sobre Bootstrap (conteúdo das páginas) */

:root {
    --kaju-orange: #ff7a2f;
    --kaju-nut-dark: #2d3142;
    --kaju-section: #383a4a;
    --kaju-bg: #f8f9fc;
    --kaju-text-strong: #171d2f;
    --kaju-text-muted: #636e8b;
    --kaju-border: #dde2ef;

    --bs-primary: #383a4a;
    --bs-primary-rgb: 56, 58, 74;
    --bs-secondary: #e8ebf0;
    --bs-secondary-rgb: 232, 235, 240;
    --bs-success: #10b981;
    --bs-success-rgb: 16, 185, 129;
    --bs-danger: #ef4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-warning: #f59e0b;
    --bs-body-bg: #f8f9fc;
    --bs-body-color: #171d2f;
    --bs-border-color: #dde2ef;
    --bs-font-sans-serif: "Segoe UI", system-ui, -apple-system, sans-serif;
    --bs-link-color: #2d3142;
    --bs-link-hover-color: #ff7a2f;
}

/* Sidebar — sobrescreve Bootstrap e links globais */
.nexum-sidebar .nexum-nav-hero ::deep a,
.nexum-sidebar .nexum-nav ::deep .nexum-nav-link,
.nexum-sidebar .nexum-nav ::deep .nexum-nav-link:link,
.nexum-sidebar .nexum-nav ::deep .nexum-nav-link:visited {
    text-decoration: none !important;
}

.nexum-sidebar .nexum-nav ::deep .nexum-nav-link {
    color: #b5bbd0 !important;
}

.nexum-sidebar .nexum-nav ::deep .nexum-nav-link:hover {
    color: #f3f6ff !important;
}

.nexum-sidebar .nexum-nav ::deep .nexum-nav-link.active {
    color: #fff !important;
}

.page-content {
    width: 100%;
    max-width: none;
    margin: 0;
}

.nexum-breadcrumb {
    margin-bottom: 0.45rem;
}

.nexum-breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--kaju-text-muted);
    line-height: 1.4;
}

.nexum-breadcrumb__item {
    display: inline-flex;
    align-items: center;
}

.nexum-breadcrumb__item:not(:last-child)::after {
    content: "›";
    margin: 0 0.45rem;
    color: #a8b0c4;
    font-weight: 600;
}

.nexum-breadcrumb__item a {
    color: var(--kaju-text-muted);
    text-decoration: none;
}

.nexum-breadcrumb__item a:hover {
    color: var(--kaju-orange);
}

.nexum-breadcrumb__item--current span {
    color: var(--kaju-text-strong);
    font-weight: 500;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--kaju-text-strong);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--kaju-text-muted);
}

/* Cards */
.card {
    border-color: var(--kaju-border);
    border-radius: 0.75rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--kaju-border);
    padding: 0.85rem 1.25rem;
}

.card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--kaju-text-strong);
}

.card-body {
    padding: 1.25rem;
}

/* Forms */
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--kaju-text-muted);
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-color: #d2cde1;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--kaju-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 47, 0.15);
    background-color: #fff;
}

.form-control:read-only {
    background-color: #f2f4fa;
}

/* Switches e checkboxes — tema Kaju */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-left: 0;
    min-height: auto;
}

.form-check-inline {
    display: inline-flex;
}

.form-check .form-check-input {
    float: none;
    margin-left: 0;
    margin-top: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.form-check .form-check-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--kaju-text-strong);
    cursor: pointer;
    line-height: 1.35;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #c5ccd9;
    border-radius: 0.35rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked {
    background-color: var(--kaju-orange);
    border-color: #e86a1f;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]:focus {
    border-color: var(--kaju-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 47, 0.18);
}

.form-check.form-switch {
    gap: 0.75rem;
}

.form-check.form-switch .form-check-input {
    --nexum-switch-thumb: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3.15' fill='%23fff'/%3e%3c/svg%3e");
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    border: 1px solid #b8c0d0;
    background-color: #c8ced8;
    background-image: var(--nexum-switch-thumb);
    background-position: left center;
    background-size: 1.45rem 1.45rem;
    transition: background-color 0.22s ease, background-position 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.form-check.form-switch .form-check-input:focus {
    border-color: rgba(255, 122, 47, 0.65);
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 47, 0.18);
}

.form-check.form-switch .form-check-input:checked {
    background-color: var(--kaju-orange);
    border-color: #e86a1f;
    background-image: var(--nexum-switch-thumb);
    background-position: right center;
    box-shadow: inset 0 1px 2px rgba(45, 49, 66, 0.12);
}

.form-check.form-switch .form-check-input:checked:focus {
    border-color: #ff9550;
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 47, 0.22), inset 0 1px 2px rgba(45, 49, 66, 0.1);
}

.form-check.form-switch .form-check-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-check .form-check-input:disabled ~ .form-check-label {
    opacity: 0.65;
    cursor: not-allowed;
}

.nexum-switch-field {
    display: flex;
    align-items: flex-end;
    min-height: 4.35rem;
    padding-bottom: 0.15rem;
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--kaju-section);
    border-color: var(--kaju-section);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--kaju-nut-dark);
    border-color: var(--kaju-nut-dark);
}

.btn-kaju {
    background: linear-gradient(135deg, var(--kaju-orange) 0%, #ff9550 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 122, 47, 0.25);
}

.btn-kaju:hover,
.btn-kaju:focus {
    background: linear-gradient(135deg, #ff8f4f 0%, #ffaa6a 100%);
    color: #fff;
}

.btn-kaju:not(:disabled):not(.disabled) {
    cursor: pointer;
    opacity: 1;
}

.btn-kaju:disabled,
.btn-kaju.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.btn-outline-secondary {
    color: var(--kaju-nut-dark);
    border-color: var(--kaju-border);
    background: #fff;
}

.btn-outline-secondary:hover {
    background: #e8ebf0;
    border-color: #d2cde1;
    color: var(--kaju-nut-dark);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.82rem;
}

/* Tables */
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    background: #e8ebf0;
    color: var(--kaju-nut-dark);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--kaju-border);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--kaju-border);
    font-size: 0.92rem;
}

.table-hover tbody tr:hover {
    background-color: #f2f4fa;
}

.table tbody tr.table-danger td {
    color: var(--bs-danger);
}

/* Badges */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

.badge-kaju {
    background: #e8ebf0;
    color: var(--kaju-nut-dark);
}

.badge-orcamento-cancelado {
    background: #842029;
    color: #fff;
}

.btn-listagem-ver-cancelados {
    --nexum-cancelado: #842029;
    --nexum-cancelado-hover: #6e1a22;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #fff;
    border: 1.5px solid var(--nexum-cancelado);
    color: var(--nexum-cancelado);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(132, 32, 41, 0.08);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-listagem-ver-cancelados:hover,
.btn-listagem-ver-cancelados:focus-visible {
    background: var(--nexum-cancelado);
    border-color: var(--nexum-cancelado);
    color: #fff;
    box-shadow: 0 2px 8px rgba(132, 32, 41, 0.22);
}

.btn-listagem-ver-cancelados__icone {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

.badge-orcamento-reaberto {
    background: #cfe2ff;
    color: #084298;
}

.badge-orcamento-nao-aprovado {
    background: #ffedd5;
    color: #9a3412;
}

.badge-os-aberta {
    background: #dbeafe;
    color: #1e40af;
}

.badge-os-concluida {
    background: #dcfce7;
    color: #166534;
}

.badge-os-cancelada {
    background: #fee2e2;
    color: #991b1b;
}

.badge-entrada-devolvida {
    background: #ccfbf1;
    color: #115e59;
}

.badge-entrada-convertida-orcamento {
    background: #dbeafe;
    color: #1e40af;
}

/* Dashboard compacto */
.dashboard-page-header .page-subtitle {
    font-size: 0.9rem;
}

.dashboard-compact {
    max-width: 100%;
}

.dashboard-compact .stat-card--compact {
    padding: 0.65rem 0.8rem;
}

.dashboard-compact .stat-card--compact .stat-label {
    font-size: 0.68rem;
    line-height: 1.2;
}

.dashboard-compact .stat-card--compact .stat-value {
    font-size: 1.35rem;
    margin-top: 0.15rem;
}

.dashboard-compact .stat-card--compact .stat-value--money {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.dashboard-compact .stat-card--compact .stat-sub {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    line-height: 1.25;
}

.dashboard-stat-grid {
    margin-bottom: 0;
}

.dashboard-stat-grid > .col {
    overflow: visible;
}

.stat-card--tip {
    position: relative;
    overflow: visible;
}

.stat-card--tip::after {
    content: attr(data-stat-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 0.5rem);
    transform: translateX(-50%) translateY(-4px);
    z-index: 30;
    width: max-content;
    max-width: min(16rem, 88vw);
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--kaju-orange);
    border-radius: 0.5rem;
    background: linear-gradient(180deg, var(--kaju-section) 0%, var(--kaju-nut-dark) 100%);
    color: #f3f6ff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: 0 8px 24px rgba(23, 29, 47, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.stat-card--tip::before {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% + 0.22rem);
    transform: translateX(-50%) translateY(-4px);
    z-index: 31;
    border: 6px solid transparent;
    border-bottom-color: var(--kaju-section);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.stat-card--tip:hover::after,
.stat-card--tip:hover::before,
.stat-card--tip:focus-within::after,
.stat-card--tip:focus-within::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Dica de status em linhas de listagem (mesmo visual do dashboard) */
.nexum-listagem-tabela,
.nexum-listagem-tabela.table-responsive,
.table-responsive.nexum-listagem-tabela,
.nexum-listagem-tabela .table-responsive {
    overflow: visible;
}

.card:has(.nexum-listagem-tabela) {
    overflow: visible;
}

.table tbody tr.nexum-linha-tip-row > td[data-stat-tip] {
    position: relative;
}

.table tbody tr.nexum-linha-tip-row:hover > td[data-stat-tip]::after {
    content: attr(data-stat-tip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.55rem);
    transform: translateY(4px);
    z-index: 40;
    width: max-content;
    max-width: min(22rem, 90vw);
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--kaju-orange);
    border-radius: 0.5rem;
    background: linear-gradient(180deg, var(--kaju-section) 0%, var(--kaju-nut-dark) 100%);
    color: #f3f6ff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(23, 29, 47, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.table tbody tr.nexum-linha-tip-row:hover > td[data-stat-tip]::before {
    content: "";
    position: absolute;
    left: 1.25rem;
    bottom: calc(100% + 0.18rem);
    transform: translateY(4px);
    z-index: 41;
    border: 6px solid transparent;
    border-top-color: var(--kaju-section);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.table tbody tr.nexum-linha-tip-row:hover > td[data-stat-tip]::after,
.table tbody tr.nexum-linha-tip-row:hover > td[data-stat-tip]::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.table tbody tr.nexum-linha-tip-row:hover {
    position: relative;
    z-index: 5;
}

.table tbody tr.nexum-linha-clicavel {
    cursor: pointer;
}

.table tbody tr.nexum-linha-clicavel:hover {
    background-color: rgba(255, 122, 0, 0.06);
}

@media (max-width: 768px) {
    .nexum-listagem-tabela .table-responsive {
        overflow-x: auto;
    }
}

.dashboard-shortcuts {
    margin-top: 0.75rem;
}

.dashboard-shortcuts .card-header {
    min-height: auto;
}

.shortcut-link--compact {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
}

.shortcut-link--compact kbd {
    font-size: 0.65rem;
    padding: 0.05rem 0.3rem;
}

.stat-recent-list--inline {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin: 0.5rem 0 0;
    padding: 0;
    font-size: 0.78rem;
}

.stat-recent-list--inline li {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
}

.stat-recent-list--inline a {
    font-weight: 600;
    text-decoration: none;
}

/* Dashboard stats */
.dashboard-stats-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--kaju-border);
}

.dashboard-stats-section__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--kaju-text-muted);
    margin: 0 0 0.85rem;
}

.stat-card {
    border: 1px solid var(--kaju-border);
    border-radius: 0.75rem;
    background: #fff;
    padding: 1.1rem 1.25rem;
    transition: box-shadow 0.15s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(23, 29, 47, 0.06);
}

.stat-card.stat-card--action {
    position: relative;
    cursor: pointer;
}

.stat-card.stat-card--action:hover {
    box-shadow: 0 4px 16px rgba(23, 29, 47, 0.1);
}

.stat-card .stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--kaju-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card .stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--kaju-text-strong);
    margin-top: 0.25rem;
    letter-spacing: -0.03em;
}

.stat-card.stat-highlight .stat-value {
    color: var(--kaju-orange);
}

.stat-card.stat-warning .stat-value {
    color: var(--bs-danger);
}

.stat-card .stat-sub {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--kaju-text-muted);
    margin-top: 0.35rem;
    line-height: 1.35;
}

/* OS totals */
.os-totals {
    background: #f2f4fa;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.os-totals p {
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.os-totals p:last-child {
    margin-bottom: 0;
    font-size: 1.05rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--kaju-border);
    margin-top: 0.5rem;
}

/* Shortcuts */
.shortcut-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 1rem;
    background: #f2f4fa;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--kaju-nut-dark);
    border: 1px solid var(--kaju-border);
    transition: all 0.15s ease;
}

.shortcut-link kbd {
    background: #fff;
    border: 1px solid var(--kaju-border);
    border-radius: 0.25rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.72rem;
    color: var(--kaju-text-muted);
}

.shortcut-link:hover {
    background: var(--kaju-section);
    color: #fff;
    border-color: var(--kaju-section);
}

/* Alerts — sucesso / aviso / erro com cores distintas */
.alert {
    border-radius: 0.5rem;
    font-size: 0.92rem;
    border-width: 1px;
    border-style: solid;
}

.nexum-alert-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
}

.nexum-alert-tag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.nexum-alert-text {
    flex: 1;
    min-width: 12rem;
}

.nexum-alert-sucesso {
    background-color: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.nexum-alert-sucesso .nexum-alert-tag {
    background-color: #10b981;
    color: #fff;
}

.nexum-alert-aviso {
    background-color: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.nexum-alert-aviso .nexum-alert-tag {
    background-color: #f59e0b;
    color: #fff;
}

.nexum-alert-erro {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.nexum-alert-erro .nexum-alert-tag {
    background-color: #ef4444;
    color: #fff;
}

.nexum-alert-info {
    background-color: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.nexum-alert-info .nexum-alert-tag {
    background-color: #3b82f6;
    color: #fff;
}

/* Toasts — canto superior direito */
.nexum-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

.nexum-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 2.25rem 1rem 0.85rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(23, 29, 47, 0.14), 0 2px 8px rgba(23, 29, 47, 0.08);
    overflow: hidden;
    pointer-events: auto;
    animation: nexum-toast-in 0.28s ease-out;
}

@keyframes nexum-toast-in {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nexum-toast__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.nexum-toast__icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.nexum-toast__content {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--kaju-text, #1f2937);
    padding-top: 0.1rem;
}

.nexum-toast__titulo {
    font-weight: 700;
    margin-right: 0.25rem;
}

.nexum-toast__texto {
    word-break: break-word;
}

.nexum-toast__fechar {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    border: 0;
    background: transparent;
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    cursor: pointer;
    border-radius: 0.25rem;
}

.nexum-toast__fechar:hover {
    color: #4b5563;
    background: rgba(0, 0, 0, 0.04);
}

.nexum-toast__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
}

.nexum-toast__progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    animation-name: nexum-toast-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes nexum-toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.nexum-toast--sucesso .nexum-toast__icon { background: #22c55e; }
.nexum-toast--sucesso .nexum-toast__progress-bar { background: #22c55e; }

.nexum-toast--erro .nexum-toast__icon { background: #ef4444; }
.nexum-toast--erro .nexum-toast__progress-bar { background: #ef4444; }

.nexum-toast--aviso .nexum-toast__icon { background: #f59e0b; }
.nexum-toast--aviso .nexum-toast__progress-bar { background: #f59e0b; }

.nexum-toast--info .nexum-toast__icon { background: #3b82f6; }
.nexum-toast--info .nexum-toast__progress-bar { background: #3b82f6; }

/* Toggle segmentado (dashboard, retirada, etc.) */
.nexum-visao-toggle {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.15rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--kaju-border);
    box-shadow: 0 1px 3px rgba(23, 29, 47, 0.05);
}

.nexum-visao-toggle__btn {
    border: none;
    background: transparent;
    color: var(--kaju-text-strong);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 1.15rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nexum-visao-toggle__btn.is-active {
    background: var(--kaju-orange);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 122, 47, 0.28);
}

.nexum-visao-toggle__btn:hover:not(.is-active) {
    color: var(--kaju-orange);
}

/* Retirada de produto */
.retirada-resumo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    overflow: visible;
}

.retirada-filtro-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--kaju-border);
    border-radius: 0.85rem;
    background: linear-gradient(160deg, #fff 0%, #f8f9fc 100%);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.retirada-filtro-card:hover,
.retirada-filtro-card:focus-visible {
    border-color: rgba(255, 122, 47, 0.45);
    box-shadow: 0 6px 18px rgba(255, 122, 47, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.retirada-filtro-card.is-ativo {
    border-color: var(--kaju-orange);
    background: linear-gradient(160deg, #fff8f2 0%, #fff 100%);
    box-shadow: 0 0 0 1px var(--kaju-orange), 0 8px 22px rgba(255, 122, 47, 0.14);
}

.retirada-filtro-card--alerta:not(.is-ativo) {
    background: linear-gradient(160deg, #fffaf5 0%, #fff 100%);
    border-color: rgba(255, 122, 47, 0.28);
}

.retirada-filtro-card--alerta .retirada-filtro-card__valor {
    color: var(--kaju-orange);
}

.retirada-filtro-card__icone {
    font-size: 1.35rem;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.retirada-filtro-card__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--kaju-text-muted);
}

.retirada-filtro-card__valor {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--kaju-text-strong);
    letter-spacing: -0.03em;
}

.retirada-filtro-card.is-ativo .retirada-filtro-card__valor {
    color: var(--kaju-orange);
}

.retirada-filtro-card__hint {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--kaju-text-muted);
    line-height: 1.35;
}

.retirada-filtro-card.stat-card--tip:hover,
.retirada-filtro-card.stat-card--tip:focus-visible {
    z-index: 30;
}

/* Tooltip só no hover ou foco por teclado — não permanece após clique com mouse */
.retirada-filtro-card.stat-card--tip:focus:not(:focus-visible)::after,
.retirada-filtro-card.stat-card--tip:focus:not(:focus-visible)::before,
.retirada-filtro-card.stat-card--tip:focus-within:not(:focus-visible)::after,
.retirada-filtro-card.stat-card--tip:focus-within:not(:focus-visible)::before {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-4px);
}

.retirada-filtro-card.stat-card--tip:focus-visible::after,
.retirada-filtro-card.stat-card--tip:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.retirada-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.retirada-status-chip--pendente {
    background: #fef3c7;
    color: #92400e;
}

.retirada-status-chip--ok {
    background: #dcfce7;
    color: #166534;
}

.retirada-anexos-grid {
    margin-top: 0.65rem;
}

.retirada-listagem-acoes {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .retirada-listagem-acoes {
        white-space: normal;
    }

    .retirada-listagem-acoes .btn {
        display: block;
        width: 100%;
        margin: 0 0 0.35rem !important;
    }

    .retirada-listagem-acoes .btn:last-child {
        margin-bottom: 0 !important;
    }

    .retirada-fotos-modal__resumo.nexum-campo-grid--2 {
        grid-template-columns: 1fr;
    }

    .retirada-fotos-modal__fotos-grid {
        grid-template-columns: repeat(auto-fill, minmax(4.85rem, 1fr));
    }
}

@media (max-width: 575.98px) {
    .retirada-resumo-cards {
        grid-template-columns: 1fr 1fr;
    }
}

.orcamento-obs-linha {
    --orcamento-obs-altura: 8rem;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: auto var(--orcamento-obs-altura);
    grid-template-areas:
        "label ."
        "campo acoes";
    gap: 0.25rem 0.65rem;
    align-items: stretch;
    margin-top: 0.75rem;
    min-width: 0;
    max-width: 100%;
}

.orcamento-obs-linha__label {
    grid-area: label;
    margin-bottom: 0;
}

.orcamento-obs-linha__campo {
    grid-area: campo;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    align-self: stretch;
}

.orcamento-obs-linha__textarea {
    grid-area: campo;
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    resize: none;
    line-height: 1.45;
}

.orcamento-obs-linha__campo .orcamento-obs-linha__textarea {
    grid-area: unset;
    flex: 1 1 auto;
}

.orcamento-obs-linha__acoes {
    grid-area: acoes;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    min-height: 0;
}

.orcamento-acao-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    padding: 0.35rem 0.4rem;
    text-align: center;
    overflow: hidden;
}

.orcamento-acao-card__titulo {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    color: #171d2f;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    white-space: normal;
}

.orcamento-acao-card__badge {
    flex-shrink: 0;
    font-size: 0.62rem;
    padding: 0.15em 0.4em;
}

.orcamento-acao-card__contador {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.15em 0.45em;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    line-height: 1.2;
}

.orcamento-acao-card__assinatura {
    font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
    font-size: 0.92rem;
    font-weight: 400;
    color: #1e3a5f;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.orcamento-acao-card--assinada {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.orcamento-acao-card--assinada:hover,
.orcamento-acao-card--assinada:focus-visible {
    background: #ecfdf5;
    border-color: #86efac;
}

.orcamento-acao-card:disabled {
    opacity: 0.65;
    cursor: default;
}

.orcamento-acao-card--processando:disabled {
    cursor: wait;
}

.orcamento-obs-linha--entrada {
    --orcamento-obs-altura: 8rem;
}

.orcamento-obs-linha--entrada .orcamento-obs-linha__campo,
.orcamento-obs-linha--entrada .orcamento-obs-linha__acoes {
    height: var(--orcamento-obs-altura);
    min-height: var(--orcamento-obs-altura);
    max-height: var(--orcamento-obs-altura);
}

.orcamento-obs-linha__acoes--compacta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.orcamento-obs-linha__acoes--entrada {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.entrada-acao--link,
.entrada-acao--orcamento {
    grid-column: 1;
    grid-row: 1;
}

.entrada-acao--converter {
    grid-column: 2;
    grid-row: 1;
}

.entrada-acao--assinatura {
    grid-column: 1;
    grid-row: 2;
}

.entrada-acao--atualizar {
    grid-column: 2;
    grid-row: 2;
}

a.orcamento-acao-card {
    text-decoration: none;
    color: inherit;
}

@media (max-width: 991.98px) {
    .orcamento-obs-linha {
        grid-template-columns: 1fr;
        grid-template-rows: auto var(--orcamento-obs-altura) auto;
        grid-template-areas:
            "label"
            "campo"
            "acoes";
    }

    .orcamento-obs-linha__textarea {
        min-height: var(--orcamento-obs-altura);
        resize: vertical;
    }

    .orcamento-obs-linha__acoes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        height: auto;
        min-height: 10rem;
    }

    .orcamento-obs-linha__acoes--compacta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-height: 8.5rem;
    }

    .orcamento-obs-linha--entrada .orcamento-obs-linha__campo,
    .orcamento-obs-linha--entrada .orcamento-obs-linha__acoes {
        height: auto;
        min-height: var(--orcamento-obs-altura);
        max-height: none;
    }

    .orcamento-obs-linha__acoes--entrada {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        min-height: 8rem;
    }
}

/* Grid compacto de campos (cards internos) */
.nexum-campo-grid {
    display: grid;
    gap: 0.65rem;
}

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

@media (max-width: 575.98px) {
    .nexum-campo-grid--2 {
        grid-template-columns: 1fr;
    }
}

.nexum-campo-bloco {
    padding: 0.65rem 0.85rem;
    background: #f8f9fc;
    border: 1px solid #e8ebf2;
    border-radius: 0.5rem;
    min-height: 100%;
}

.nexum-campo-bloco__rotulo {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #636e8b;
    margin-bottom: 0.35rem;
}

.nexum-campo-bloco__valor {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #171d2f;
    line-height: 1.45;
}

.nexum-campo-bloco--largo {
    grid-column: 1 / -1;
}

.nexum-campo-bloco--relato .nexum-campo-bloco__valor {
    font-weight: 400;
}

button.nexum-campo-bloco--acao {
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

button.nexum-campo-bloco--acao:hover,
button.nexum-campo-bloco--acao:focus-visible {
    border-color: var(--kaju-orange);
    background: #fff8f2;
    box-shadow: 0 0 0 1px rgba(255, 122, 0, 0.15);
}

.nexum-campo-bloco__hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: #636e8b;
}

.retirada-fotos-modal {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.retirada-fotos-modal__resumo {
    margin-top: 0;
}

@media (min-width: 768px) {
    .retirada-fotos-modal__resumo.nexum-campo-grid--2 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .retirada-fotos-modal__resumo .nexum-campo-bloco--largo {
        grid-column: 1 / -1;
    }
}

.retirada-fotos-modal__galeria {
    margin-top: 0;
}

.retirada-fotos-modal__grupo {
    display: flex;
    flex-direction: column;
    min-height: 10rem;
}

.retirada-fotos-modal__grupo-topo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.15rem;
}

.retirada-fotos-modal__grupo .nexum-campo-bloco__hint {
    margin-top: 0;
}

.retirada-fotos-modal__fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.retirada-fotos-modal__foto-card {
    padding: 0.45rem;
    min-width: 0;
    background: #fff;
}

.retirada-fotos-modal__foto-link {
    display: block;
    border-radius: 0.35rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.retirada-fotos-modal__foto-link:hover,
.retirada-fotos-modal__foto-link:focus-visible {
    border-color: var(--kaju-orange);
    box-shadow: 0 0 0 1px rgba(255, 122, 0, 0.15);
}

.retirada-fotos-modal__foto-link img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.retirada-fotos-modal__foto-nome {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    color: #636e8b;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.retirada-fotos-modal__vazio {
    margin-top: 0.75rem;
    padding: 1.35rem 1rem;
    text-align: center;
    border: 1px dashed #c5cad6;
    border-radius: 0.5rem;
    background: #fafbfc;
    color: #636e8b;
    font-size: 0.84rem;
    line-height: 1.45;
}

/* Chave NF monospace */
.chave-nf {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.78rem;
    word-break: break-all;
}

.fiscal-xml-preview {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.35;
    max-height: min(60vh, 28rem);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f6f8fa;
    border: 1px solid var(--kaju-border);
    border-radius: 0.375rem;
    padding: 0.75rem;
}

.page-hint {
    font-size: 0.82rem;
    color: var(--kaju-text-muted);
    margin-top: 0.35rem;
}

.page-hint kbd {
    background: #e8ebf0;
    border: 1px solid var(--kaju-border);
    border-radius: 0.25rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.75rem;
}

.modal-header .modal-title {
    color: var(--kaju-text-strong);
}

.modal-footer kbd {
    font-size: 0.7rem;
    opacity: 0.85;
}

.nexum-fiscal-padroes summary {
    cursor: pointer;
    color: var(--kaju-text-strong);
}

.nexum-fiscal-padroes[open] summary {
    margin-bottom: 0.25rem;
}

/* Configurações — navegação e seções */
.nexum-config-nav {
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid var(--kaju-border);
    border-radius: 0.75rem;
}

.nexum-config-nav .nav-link {
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--kaju-text-muted);
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
}

.nexum-config-nav .nav-link:hover {
    color: var(--kaju-text-strong);
    background: #f2f4fa;
}

.nexum-config-nav .nav-link.active {
    background: var(--kaju-section);
    color: #fff;
}

.nexum-config-status .stat-card {
    padding: 0.95rem 1.1rem;
}

.nexum-config-status .stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

.nexum-config-status .stat-value.text-success {
    color: var(--bs-success) !important;
}

.nexum-config-status .stat-value.text-danger {
    color: var(--bs-danger) !important;
}

.nexum-config-status .stat-value.text-warning {
    color: var(--bs-warning) !important;
}

.nexum-config-section {
    border: 1px solid var(--kaju-border);
    border-radius: 0.75rem;
    background: #fff;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
}

.nexum-config-section:last-child {
    margin-bottom: 0;
}

.nexum-config-section__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--kaju-text-strong);
    margin-bottom: 0.25rem;
}

.produto-impostort-card {
    border: 1px solid var(--kaju-border);
    border-radius: 0.65rem;
    margin-bottom: 0.85rem;
    overflow: hidden;
}

.produto-impostort-card > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.55rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    background: #eaf2fd;
    color: #1d4ed8;
}

.produto-impostort-card > summary::-webkit-details-marker {
    display: none;
}

.produto-impostort-card[open] > summary {
    border-bottom: 1px solid var(--kaju-border);
}

.produto-impostort-card .produto-impostort-body {
    padding: 0.9rem 1rem;
}

.nexum-config-section__hint {
    font-size: 0.82rem;
    color: var(--kaju-text-muted);
    margin-bottom: 1rem;
}

.nexum-config-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--kaju-border);
}

.nexum-config-cert-box {
    border: 1px solid var(--kaju-border);
    border-radius: 0.65rem;
    padding: 1rem 1.15rem;
    background: #f8fafc;
}

.nexum-config-logo-preview {
    max-height: 72px;
    max-width: 200px;
    object-fit: contain;
    border: 1px solid var(--kaju-border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: #fff;
}

/* Permissões — painel visual */
.nexum-permissoes-loading,
.nexum-permissoes-empty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 1px dashed var(--kaju-border);
    border-radius: 0.75rem;
    background: #f8fafc;
}

.nexum-permissoes-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 1.25rem;
    min-height: 420px;
}

@media (max-width: 991.98px) {
    .nexum-permissoes-layout {
        grid-template-columns: 1fr;
    }
}

.nexum-permissoes-usuarios {
    border: 1px solid var(--kaju-border);
    border-radius: 0.75rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nexum-permissoes-usuarios__head {
    padding: 1rem 1rem 0.5rem;
}

.nexum-permissoes-search {
    padding: 0 1rem 0.75rem;
}

.nexum-permissoes-usuarios__list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0.65rem 0.65rem;
    overflow: auto;
    max-height: 520px;
}

.nexum-permissoes-usuario {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    background: #fff;
    padding: 0.65rem 0.75rem;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.nexum-permissoes-usuario:hover {
    border-color: var(--kaju-border);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.nexum-permissoes-usuario--ativo {
    border-color: var(--kaju-section);
    background: #eef2ff;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.15);
}

.nexum-permissoes-usuario__avatar {
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--kaju-section);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nexum-permissoes-usuario__info {
    flex: 1 1 auto;
    min-width: 0;
}

.nexum-permissoes-usuario__nome {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--kaju-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nexum-permissoes-usuario__email {
    display: block;
    font-size: 0.75rem;
    color: var(--kaju-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nexum-permissoes-usuario__meta {
    flex: 0 0 auto;
}

.nexum-permissoes-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
}

.nexum-permissoes-badge--admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.nexum-permissoes-editor {
    border: 1px solid var(--kaju-border);
    border-radius: 0.75rem;
    background: #fff;
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nexum-permissoes-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--kaju-text-muted);
}

.nexum-permissoes-placeholder__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #e0e7ff, #f1f5f9);
    border: 1px solid var(--kaju-border);
}

.nexum-permissoes-editor__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--kaju-border);
}

.nexum-permissoes-resumo {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--kaju-section);
    background: #eef2ff;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
}

.nexum-permissoes-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--kaju-border);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: #f8fafc;
    cursor: pointer;
}

.nexum-permissoes-admin--ativo {
    border-color: #93c5fd;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.nexum-permissoes-admin__titulo {
    display: block;
    font-weight: 700;
    color: var(--kaju-text-strong);
}

.nexum-permissoes-admin__hint {
    display: block;
    font-size: 0.8rem;
    color: var(--kaju-text-muted);
    margin-top: 0.15rem;
}

.nexum-permissoes-admin-info {
    margin-bottom: 1rem !important;
}

.nexum-permissoes-modulos-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 1rem;
}

.nexum-permissoes-modulos-toolbar .form-control {
    flex: 1 1 180px;
    min-width: 0;
}

.nexum-permissoes-grupos {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1 1 auto;
    overflow: auto;
    max-height: 460px;
    padding-right: 0.15rem;
    padding-bottom: 0.35rem;
}

.nexum-permissoes-modulo.stat-card--tip::after,
.nexum-permissoes-admin.stat-card--tip::after {
    left: 0;
    top: auto;
    bottom: calc(100% + 0.45rem);
    transform: translateX(0) translateY(4px);
    text-align: left;
    max-width: min(20rem, calc(100vw - 2rem));
}

.nexum-permissoes-modulo.stat-card--tip::before,
.nexum-permissoes-admin.stat-card--tip::before {
    left: 1.25rem;
    top: auto;
    bottom: calc(100% + 0.12rem);
    transform: translateX(0) translateY(4px);
    border-bottom-color: transparent;
    border-top-color: var(--kaju-section);
}

.nexum-permissoes-modulo.stat-card--tip:hover::after,
.nexum-permissoes-modulo.stat-card--tip:focus-visible::after,
.nexum-permissoes-modulo.stat-card--tip:hover::before,
.nexum-permissoes-modulo.stat-card--tip:focus-visible::before,
.nexum-permissoes-admin.stat-card--tip:hover::after,
.nexum-permissoes-admin.stat-card--tip:focus-within::after,
.nexum-permissoes-admin.stat-card--tip:hover::before,
.nexum-permissoes-admin.stat-card--tip:focus-within::before {
    transform: translateX(0) translateY(0);
}

.nexum-financeiro-lancar .card-body {
    padding: 0;
}

.nexum-fin-sec {
    padding: 1.25rem 1.5rem;
}

.nexum-fin-sec + .nexum-fin-sec {
    border-top: 1px solid var(--kaju-border);
}

.nexum-fin-sec__head {
    margin-bottom: 0.85rem;
}

.nexum-fin-sec__titulo {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--kaju-section);
}

.nexum-fin-sec__body .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--kaju-text-strong);
    margin-bottom: 0.35rem;
}

.nexum-fin-tipo-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.25rem;
    background: #f4f6fa;
    border: 1px solid var(--kaju-border);
    border-radius: 0.65rem;
}

.nexum-fin-tipo-pills__btn {
    border: none;
    background: transparent;
    color: var(--kaju-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 0.45rem;
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nexum-fin-tipo-pills__btn:hover {
    color: var(--kaju-text-strong);
    background: rgba(255, 255, 255, 0.7);
}

.nexum-fin-tipo-pills__btn.active {
    background: #fff;
    color: var(--kaju-section);
    box-shadow: 0 1px 3px rgba(23, 29, 47, 0.1);
}

.nexum-fin-sec__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1rem 1.5rem 1.35rem;
    border-top: 1px solid var(--kaju-border);
    background: #fafbfc;
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

.nexum-fin-sec--aviso {
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.nexum-fin-sec--aviso .alert {
    margin-bottom: 0;
}

.nexum-financeiro-lancar-ref {
    border-top: 1px solid var(--kaju-border);
    margin-top: 0.35rem;
    padding-top: 1.1rem;
}

.nexum-financeiro-lancar-ref .form-label {
    font-weight: 600;
    color: var(--kaju-text-strong);
}

.nexum-financeiro-empresa-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--kaju-text-muted);
}

.nexum-financeiro-empresa-badge strong {
    color: var(--kaju-section);
    font-weight: 600;
}

.nexum-listagem-empresa-f9 {
    font-size: 0.82rem;
}

.nexum-listagem-empresa-f9 strong {
    color: var(--kaju-section);
}

.nexum-permissoes-grupo {
    border: 1px solid var(--kaju-border);
    border-radius: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: #fafbfc;
    overflow: visible;
}

.nexum-permissoes-grupo__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.nexum-permissoes-grupo__titulo {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.nexum-permissoes-grupo__titulo h6 {
    font-size: 0.9rem;
    font-weight: 700;
}

.nexum-permissoes-grupo__icone {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
}

.nexum-permissoes-grupo__icone--op { background: #6366f1; }
.nexum-permissoes-grupo__icone--ac { background: #8b5cf6; }
.nexum-permissoes-grupo__icone--cd { background: #0ea5e9; }
.nexum-permissoes-grupo__icone--es { background: #14b8a6; }
.nexum-permissoes-grupo__icone--fi { background: #f59e0b; }
.nexum-permissoes-grupo__icone--fn { background: #10b981; }
.nexum-permissoes-grupo__icone--sy { background: #64748b; }

.nexum-permissoes-grupo__acoes {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
}

.nexum-permissoes-grupo__contagem {
    font-weight: 700;
    color: var(--kaju-text-muted);
    margin-right: 0.25rem;
}

.nexum-permissoes-modulos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow: visible;
}

.nexum-permissoes-modulo {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--kaju-border);
    border-radius: 999px;
    background: #fff;
    padding: 0.4rem 0.85rem 0.4rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--kaju-text-strong);
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: visible;
}

.nexum-permissoes-modulo.stat-card--tip:hover,
.nexum-permissoes-modulo.stat-card--tip:focus-visible {
    z-index: 50;
}

.nexum-permissoes-admin.stat-card--tip {
    position: relative;
    overflow: visible;
}

.nexum-permissoes-admin.stat-card--tip:hover,
.nexum-permissoes-admin.stat-card--tip:focus-within {
    z-index: 50;
}

.nexum-permissoes-modulo:hover {
    border-color: #c7d2fe;
    background: #f8fafc;
}

.nexum-permissoes-modulo--ativo {
    border-color: var(--kaju-section);
    background: #eef2ff;
    color: #3730a3;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.nexum-permissoes-modulo__check {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #fff;
    position: relative;
    flex: 0 0 auto;
}

.nexum-permissoes-modulo--ativo .nexum-permissoes-modulo__check {
    border-color: var(--kaju-section);
    background: var(--kaju-section);
}

.nexum-permissoes-modulo--ativo .nexum-permissoes-modulo__check::after {
    content: "";
    position: absolute;
    left: 0.28rem;
    top: 0.12rem;
    width: 0.28rem;
    height: 0.48rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.nexum-permissoes-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--kaju-border);
}

.nexum-senha-input__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding-inline: 0.65rem;
}

.nexum-senha-requisitos {
    border: 1px solid var(--kaju-border);
    border-radius: 0.65rem;
    padding: 1rem 1.15rem;
    background: #f8fafc;
}

.nexum-senha-requisitos__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--kaju-text);
    margin: 0 0 0.65rem;
}

.nexum-senha-requisitos__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.nexum-senha-requisitos__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.84rem;
    color: var(--kaju-text-muted);
}

.nexum-senha-requisitos__item.is-met {
    color: #15803d;
}

.nexum-senha-requisitos__icon {
    width: 1.1rem;
    flex-shrink: 0;
    font-weight: 700;
    text-align: center;
}

.nexum-senha-requisitos__ok {
    margin: 0.85rem 0 0;
    font-size: 0.82rem;
    color: #15803d;
    font-weight: 600;
}

/* NF-e recebidas — busca SEFAZ */
.dfe-sync-painel {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem 1.35rem;
    border-radius: 0.75rem;
    border: 1px solid #93c5fd;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.dfe-sync-painel__icone {
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.dfe-sync-painel__texto h2 {
    color: var(--kaju-text-strong);
    font-weight: 600;
}

.dfe-painel-linha {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 767.98px) {
    .dfe-painel-linha {
        grid-template-columns: 1fr;
    }
}

.dfe-intro-card,
.dfe-status-card {
    padding: 0.85rem 1.1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--kaju-border);
    background: #fff;
}

.dfe-intro-card {
    display: flex;
    align-items: center;
    min-height: 100%;
    color: var(--kaju-text-strong);
    font-size: 0.95rem;
}

.dfe-status-card {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.dfe-status-card__item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dfe-status-card__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--kaju-text-muted);
}

.dfe-empty-state {
    max-width: 28rem;
    margin: 0 auto;
}

.dfe-bloqueio-banner {
    padding: 1rem 1.2rem;
    border-radius: 0.5rem;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
}

.dfe-bloqueio-banner strong {
    color: #78350f;
}

.dfe-bloqueio-banner__contador {
    font-weight: 600;
    white-space: nowrap;
}

.dfe-consulta-chave {
    padding: 1rem 1.2rem;
    border-radius: 0.5rem;
    border: 1px solid #dbeafe;
    background: #f8fafc;
}

.dfe-consulta-chave .form-control.font-monospace {
    letter-spacing: 0.02em;
}

button:disabled.btn-primary,
button:disabled.btn-outline-warning {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Entrada de mercadoria — conferência */
.entrada-cabecalho-card {
    padding: 1rem 1.2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--kaju-border);
    background: #fff;
}

.entrada-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--kaju-text-muted);
    margin-bottom: 0.15rem;
}

.entrada-legenda {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.entrada-legenda--ref { background: #bbf7d0; }
.entrada-legenda--ean { background: #fed7aa; }
.entrada-legenda--hist { background: #bfdbfe; }
.entrada-legenda--manual { background: #e9d5ff; }
.entrada-legenda--sem { background: #fecaca; }

.entrada-itens-table tr.entrada-linha--ref { background: #f0fdf4; }
.entrada-itens-table tr.entrada-linha--ean { background: #fff7ed; }
.entrada-itens-table tr.entrada-linha--hist { background: #eff6ff; }
.entrada-itens-table tr.entrada-linha--manual { background: #faf5ff; }
.entrada-itens-table tr.entrada-linha--sem { background: #fef2f2; }

/* Densidade compacta — telas abaixo de 1600px (evita depender de zoom do navegador) */
@media (max-width: 1599.98px) {
    .nexum-main {
        --nexum-main-pad-x: 1.45rem;
        --nexum-main-pad-top: 1.35rem;
        --nexum-main-pad-bottom: 1.5rem;
        padding: var(--nexum-main-pad-top) var(--nexum-main-pad-x) var(--nexum-main-pad-bottom);
    }

    .nexum-main .page-content {
        padding-top: 1.85rem;
    }

    .page-title {
        font-size: 1.45rem;
    }

    .page-subtitle {
        font-size: 0.88rem;
    }

    .card-header {
        padding: 0.7rem 1rem;
    }

    .card-body {
        padding: 0.85rem 1rem;
    }

    .stat-card {
        padding: 0.85rem 1rem;
    }

    .nexum-campo-bloco {
        padding: 0.55rem 0.72rem;
    }

    .nexum-campo-grid {
        gap: 0.55rem;
    }

    .retirada-resumo-cards {
        gap: 0.6rem;
        margin-bottom: 0.85rem;
    }

    .doc-anexo-thumb {
        width: 64px;
        height: 64px;
    }
}
