:root {
    --nf-bg: #eef3fb;
    --nf-surface: #ffffff;
    --nf-surface-soft: #fdf0f1;
    --nf-primary: #1553ad;
    --nf-primary-dark: #0d3f86;
    --nf-secondary: #0f2857;
    --nf-accent: #ff575f;
    --nf-text: #18253b;
    --nf-muted: #64718a;
    --nf-border: rgba(21, 83, 173, 0.14);
    --nf-shadow: 0 24px 60px rgba(15, 40, 87, 0.14);
}

.nf-processing-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(15, 40, 87, 0.38);
    backdrop-filter: blur(2px);
}

.nf-processing-modal {
    position: fixed;
    inset: 0;
    z-index: 1410;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.nf-processing-card {
    width: min(100%, 30rem);
    padding: 2rem 1.75rem;
    border-radius: 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.98);
}

.nf-processing-spinner {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 0.3rem solid rgba(21, 83, 173, 0.14);
    border-top-color: var(--nf-primary);
    animation: nf-processing-spin 0.9s linear infinite;
}

.nf-processing-steps {
    display: grid;
    gap: 0.65rem;
    text-align: left;
}

.nf-processing-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: 1rem;
    background: rgba(21, 83, 173, 0.06);
    color: var(--nf-muted);
    transition: all 0.2s ease;
}

.nf-processing-step::before {
    content: "";
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: rgba(21, 83, 173, 0.18);
    box-shadow: 0 0 0 0.28rem rgba(21, 83, 173, 0.08);
}

.nf-processing-step.is-active {
    background: rgba(21, 83, 173, 0.12);
    color: var(--nf-secondary);
    font-weight: 700;
}

.nf-processing-step.is-active::before {
    background: var(--nf-primary);
    box-shadow: 0 0 0 0.28rem rgba(21, 83, 173, 0.16);
}

@keyframes nf-processing-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--nf-text);
    background:
        radial-gradient(circle at top left, rgba(255, 87, 95, 0.12), transparent 26%),
        radial-gradient(circle at top right, rgba(21, 83, 173, 0.12), transparent 24%),
        linear-gradient(180deg, #fdfefe 0%, var(--nf-bg) 100%);
}

.page-shell {
    min-height: 100vh;
}

.hero-section {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 80% 10%, rgba(255, 87, 95, 0.16), transparent 20%),
        radial-gradient(circle at 18% 18%, rgba(21, 83, 173, 0.12), transparent 20%),
        linear-gradient(135deg, #ffffff 0%, #f2f6fd 48%, #eef2fb 100%);
}

.hero-section::after {
    content: "";
    position: absolute;
    inset: auto -10% -120px auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(21, 83, 173, 0.08);
    filter: blur(10px);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    color: var(--nf-secondary);
}

.brand-mark img {
    display: block;
    width: auto;
    height: 3.5rem;
    max-width: min(20rem, 100%);
    object-fit: contain;
    object-position: left center;
}

.nav-link,
.nav-cta {
    color: var(--nf-secondary);
    font-weight: 600;
}

.nav-link:hover,
.nav-cta:hover,
.brand-mark:hover {
    color: var(--nf-primary-dark);
}

.py-lg-6 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(23, 51, 40, 0.07);
    color: var(--nf-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eyebrow-green {
    background: rgba(255, 87, 95, 0.12);
    color: var(--nf-accent);
}

.hero-copy {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--nf-muted);
    max-width: 38rem;
}

.btn-primary {
    --bs-btn-bg: var(--nf-primary);
    --bs-btn-border-color: var(--nf-primary);
    --bs-btn-hover-bg: var(--nf-primary-dark);
    --bs-btn-hover-border-color: var(--nf-primary-dark);
    --bs-btn-active-bg: var(--nf-primary-dark);
    --bs-btn-active-border-color: var(--nf-primary-dark);
    --bs-btn-padding-y: 0.9rem;
    --bs-btn-font-weight: 700;
}

.metric-card,
.panel-card,
.feature-card,
.insight-board,
.cta-banner {
    border: 1px solid var(--nf-border);
    box-shadow: var(--nf-shadow);
}

.metric-card {
    height: 100%;
    padding: 1.1rem 1rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
}

.metric-card strong {
    display: block;
    font-size: 1.35rem;
    color: var(--nf-secondary);
}

.metric-card span {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.92rem;
    color: var(--nf-muted);
}

.hero-panel {
    position: relative;
    padding: 1.4rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(25, 135, 84, 0.14);
    box-shadow: 0 30px 70px rgba(16, 46, 33, 0.14);
}

.hero-panel-top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    color: var(--nf-muted);
    font-weight: 700;
}

.status-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0.35rem rgba(34, 197, 94, 0.18);
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.panel-card {
    padding: 1.2rem;
    border-radius: 1.4rem;
    background: var(--nf-surface);
}

.panel-card span {
    display: block;
    font-size: 0.92rem;
    color: var(--nf-muted);
}

.panel-card strong {
    display: block;
    margin: 0.4rem 0;
    font-size: 1.7rem;
    color: var(--nf-secondary);
}

.panel-card small,
.panel-card li {
    color: var(--nf-muted);
    line-height: 1.6;
}

.panel-card-primary {
    background: linear-gradient(135deg, #0f2857 0%, #1553ad 100%);
}

.panel-card-primary span,
.panel-card-primary strong,
.panel-card-primary small {
    color: #f4fff7;
}

.panel-highlight {
    background: var(--nf-surface-soft);
}

.logo-strip {
    background: rgba(21, 83, 173, 0.04);
    border-top: 1px solid rgba(21, 83, 173, 0.06);
    border-bottom: 1px solid rgba(21, 83, 173, 0.06);
}

.logo-strip span {
    font-weight: 800;
    letter-spacing: 0.18em;
    color: rgba(15, 40, 87, 0.56);
}

.section-heading {
    max-width: 44rem;
}

.section-heading h2,
#beneficios h2,
.cta-banner h2 {
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--nf-secondary);
}

.feature-card {
    padding: 1.7rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
}

.feature-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    margin-bottom: 1.1rem;
    background: rgba(25, 135, 84, 0.14);
    color: var(--nf-primary-dark);
    font-size: 1.25rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.7rem;
}

.feature-card p,
.insight-column p,
.cta-banner p {
    color: var(--nf-muted);
    line-height: 1.7;
    margin-bottom: 0;
}

.benefit-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    color: var(--nf-secondary);
    font-weight: 600;
}

.benefit-list li::before {
    content: "\F26E";
    position: absolute;
    left: 0;
    top: 0;
    font-family: "bootstrap-icons";
    color: var(--nf-primary);
}

.insight-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, #fff 0%, #f0f8f2 100%);
}

.insight-column {
    padding: 1.4rem;
    border-radius: 1.4rem;
    background: rgba(255, 255, 255, 0.9);
}

.board-label {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nf-primary-dark);
}

.insight-column strong {
    display: block;
    margin: 0.65rem 0 0.75rem;
    font-size: 2rem;
    color: var(--nf-secondary);
}

.cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, #173328 0%, #255d46 100%);
}

.cta-banner .eyebrow,
.cta-banner h2,
.cta-banner p {
    color: #f2fff6;
}

.cta-banner .eyebrow {
    background: rgba(255, 255, 255, 0.12);
}

[data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 991.98px) {
    .hero-grid,
    .insight-board {
        grid-template-columns: 1fr;
    }

    .cta-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .brand-mark img {
        height: 2.8rem;
        max-width: min(16rem, 100%);
    }

    .hero-panel,
    .feature-card,
    .cta-banner,
    .insight-board {
        border-radius: 1.5rem;
    }

    .display-4 {
        font-size: 2.5rem;
    }
}

.auth-body {
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--nf-text);
    background:
        radial-gradient(circle at top right, rgba(25, 135, 84, 0.14), transparent 22%),
        linear-gradient(180deg, #f8fcf8 0%, #edf6ef 100%);
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(320px, 640px);
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    align-items: center;
}

.auth-layout-wide {
    grid-template-columns: minmax(280px, 420px) minmax(320px, 760px);
}

.auth-aside {
    padding: 2rem;
}

.auth-aside h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--nf-secondary);
}

.auth-aside p {
    color: var(--nf-muted);
    line-height: 1.8;
    font-size: 1.05rem;
}

.auth-card-wrap {
    width: 100%;
}

.auth-card {
    padding: 2rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--nf-border);
    box-shadow: var(--nf-shadow);
}

.dashboard-card {
    max-width: 980px;
    padding: 2rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--nf-border);
    box-shadow: var(--nf-shadow);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    align-items: start;
    transition: grid-template-columns 0.28s ease;
}

.dashboard-layout > .dashboard-card {
    width: 100%;
    max-width: none;
    min-width: 0;
    align-self: start;
}

.dashboard-layout.dashboard-with-toggle.is-sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
}

.dashboard-layout.dashboard-with-toggle .sidebar-card > div:first-child {
    display: none;
}

.sidebar-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--nf-border);
    box-shadow: var(--nf-shadow);
    min-height: calc(100vh - 3rem);
    transition: transform 0.28s ease, opacity 0.22s ease, visibility 0.22s ease;
}

.dashboard-layout.dashboard-with-toggle.is-sidebar-collapsed .sidebar-card {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-1rem);
    pointer-events: none;
}

.sidebar-copy {
    color: var(--nf-muted);
    line-height: 1.7;
}

.sidebar-nav {
    display: grid;
    gap: 0.75rem;
}

.sidebar-link {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    text-decoration: none;
    color: var(--nf-secondary);
    background: rgba(237, 247, 238, 0.55);
    font-weight: 700;
}

.sidebar-link.is-active,
.sidebar-link:hover {
    background: rgba(25, 135, 84, 0.12);
    color: var(--nf-primary-dark);
}

.company-selector {
    display: grid;
    gap: 0.85rem;
}

.company-active-card {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--nf-border);
    border-radius: 1.2rem;
    background: rgba(237, 247, 238, 0.45);
}

.company-certificate-alert {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(220, 53, 69, 0.18);
    background: linear-gradient(180deg, rgba(255, 243, 244, 0.98) 0%, rgba(255, 250, 250, 0.98) 100%);
    box-shadow: 0 16px 28px rgba(220, 53, 69, 0.08);
}

.company-certificate-alert-expiring {
    border-color: rgba(255, 152, 0, 0.22);
    background: linear-gradient(180deg, rgba(255, 247, 235, 0.98) 0%, rgba(255, 251, 244, 0.98) 100%);
    box-shadow: 0 16px 28px rgba(255, 152, 0, 0.08);
}

.company-certificate-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #b42318;
}

.company-certificate-alert-expiring .company-certificate-kicker {
    color: #b54708;
}

.company-certificate-copy {
    color: var(--nf-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.company-active-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.company-active-header .eyebrow-green {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.company-selector-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
}

.company-action-links {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.company-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
    border: 1px solid var(--nf-border);
    background: rgba(237, 247, 238, 0.55);
    color: var(--nf-primary-dark);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 800;
}

.company-edit-link:hover {
    background: rgba(25, 135, 84, 0.12);
    color: var(--nf-primary-dark);
}

.company-selector > .btn-outline-success,
.empty-state-card > .btn-primary {
    --bs-btn-color: var(--nf-primary);
    --bs-btn-border-color: var(--nf-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nf-primary-dark);
    --bs-btn-hover-border-color: var(--nf-primary-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nf-primary-dark);
    --bs-btn-active-border-color: var(--nf-primary-dark);
}

.sidebar-dashboard-link {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    text-decoration: none;
    color: var(--nf-secondary);
    background: linear-gradient(135deg, #0f2857 0%, #1553ad 100%);
    color: #f8fbff;
    font-weight: 800;
    box-shadow: 0 16px 28px rgba(15, 40, 87, 0.18);
}

.sidebar-dashboard-link:hover,
.sidebar-dashboard-link.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #12306a 0%, #1d63cb 100%);
}

.edit-company-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.edit-company-card {
    width: min(980px, 100%);
}

.sidebar-accordion {
    display: grid;
    gap: 0.85rem;
}

.sidebar-accordion-item {
    border-radius: 1rem;
    border: 1px solid var(--nf-border);
    background: rgba(237, 247, 238, 0.45);
    overflow: hidden;
}

.sidebar-accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 0;
    background: transparent;
    color: var(--nf-secondary);
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    list-style: none;
}

.sidebar-accordion-trigger::-webkit-details-marker {
    display: none;
}

.sidebar-accordion-trigger b {
    font-size: 1.2rem;
    line-height: 1;
    color: var(--nf-primary-dark);
    transition: transform 0.2s ease;
}

.sidebar-accordion-trigger.is-open {
    background: rgba(25, 135, 84, 0.12);
}

.sidebar-accordion-item[open] .sidebar-accordion-trigger {
    background: rgba(25, 135, 84, 0.12);
}

.sidebar-accordion-item[open] .sidebar-accordion-trigger b {
    transform: rotate(45deg);
}

.sidebar-accordion-panel {
    display: none;
    padding: 0.55rem 1rem 1rem;
}

.sidebar-accordion-panel.is-open {
    display: grid;
    gap: 0.6rem;
}

.sidebar-accordion-item[open] .sidebar-accordion-panel {
    display: grid;
    gap: 0.6rem;
}

.sidebar-sublink {
    display: block;
    padding: 0.85rem 0.9rem;
    border-radius: 0.85rem;
    text-decoration: none;
    color: var(--nf-secondary);
    background: rgba(255, 255, 255, 0.88);
    font-weight: 700;
}

.sidebar-sublink.is-locked {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(52, 71, 103, 0.72);
    background: rgba(228, 234, 244, 0.75);
    cursor: default;
}

.sidebar-sublink.is-locked:hover {
    color: rgba(52, 71, 103, 0.72);
    background: rgba(228, 234, 244, 0.75);
}

.sidebar-lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    min-width: 1rem;
    color: #8b95a7;
    font-size: 0.9rem;
    line-height: 1;
}

.sidebar-sublink:hover {
    background: rgba(25, 135, 84, 0.1);
    color: var(--nf-primary-dark);
}

.sidebar-sublink.is-active {
    background: rgba(25, 135, 84, 0.14);
    color: var(--nf-primary-dark);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.sidebar-footer .btn-outline-success {
    --bs-btn-color: #dc3545;
    --bs-btn-border-color: #dc3545;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #bb2d3b;
    --bs-btn-hover-border-color: #bb2d3b;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #b02a37;
    --bs-btn-active-border-color: #b02a37;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    grid-column: 1 / -1;
    padding: 1rem 1.25rem;
    border-radius: 1.5rem;
    border: 1px solid var(--nf-border);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--nf-shadow);
    z-index: 1300;
}

.dashboard-topbar-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.dashboard-topbar-brand img {
    display: block;
    width: auto;
    height: 2.5rem;
}

.sidebar-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--nf-border);
    background: rgba(255, 255, 255, 0.96);
    color: var(--nf-secondary);
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(15, 40, 87, 0.08);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle-button:hover {
    background: rgba(237, 244, 255, 0.96);
    border-color: rgba(21, 83, 173, 0.28);
    transform: translateY(-1px);
}

.sidebar-toggle-button {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    padding: 0;
}

.sidebar-toggle-button span {
    font-size: 1.1rem;
    line-height: 1;
}

.sidebar-overlay {
    display: none;
}

.clients-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.clients-filter-toggle-wrap {
    margin: 0.75rem 0 0;
}

.clients-filter-toggle-btn {
    font-size: 0.82rem;
    padding: 0.3rem 0.9rem;
    gap: 0.35rem;
    display: inline-flex;
    align-items: center;
}

.clients-filter-toggle-btn.is-active {
    background: var(--nf-primary, #1553ad);
    color: #fff;
    border-color: var(--nf-primary, #1553ad);
}

.clients-search-bar {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    margin: 0.75rem 0 0.5rem;
}

.clients-search-bar.d-none {
    display: none !important;
}

.clients-table-wrap,
.clients-table-wrap.table-responsive {
    height: calc(100vh - 320px);
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto !important;
    overflow-x: auto;
    border: 1px solid var(--nf-border);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.9);
}

.clients-table-wrap.is-loading {
    position: relative;
}

.table-skeleton-row td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.table-loading-row td {
    padding: 1.15rem 1rem;
}

.table-loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #526277;
    font-weight: 600;
}

.table-loading-spinner {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    border: 2px solid #d9e4f2;
    border-top-color: #1553ad;
    animation: tableLoadingSpin 0.8s linear infinite;
    flex: 0 0 auto;
}

.table-skeleton-line {
    display: block;
    width: 100%;
    height: 0.9rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #eef2f7 0%, #ffffff 50%, #eef2f7 100%);
    background-size: 220% 100%;
    animation: notafacilSkeletonPulse 1.2s ease-in-out infinite;
}

.table-skeleton-line.is-short {
    width: 58%;
}

.table-skeleton-line.is-medium {
    width: 78%;
}

@keyframes notafacilSkeletonPulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -20% 0;
    }
}

@keyframes tableLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

.sales-more-wrap {
    position: relative;
    display: inline-block;
}

.sales-more-button {
    min-width: 2rem;
    min-height: 2rem;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.15rem 0.4rem;
}

.sales-more-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1200;
    background: #fff;
    border: 1px solid var(--nf-border, #d8e1ef);
    border-radius: 0.75rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 140px;
    white-space: nowrap;
}

.sales-more-menu.d-none {
    display: none !important;
}

.sales-more-menu .btn {
    text-align: left;
    justify-content: flex-start;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    padding: 0.4rem 0.65rem;
    gap: 0.4rem;
}

.clients-table {
    margin-bottom: 0;
}

.dashboard-overview {
    display: grid;
    gap: 1.5rem;
}

.dashboard-filter-card,
.dashboard-insight-card {
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--nf-border);
    background: #ffffff;
    box-shadow: var(--nf-shadow);
}

.dashboard-filter-grid,
.dashboard-custom-range,
.dashboard-panel-grid,
.dashboard-metric-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-filter-grid {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 260px);
    margin-top: 1.5rem;
}

.dashboard-custom-range {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metric-card {
    display: grid;
    gap: 0.65rem;
    width: 100%;
    padding: 1.5rem;
    border: 1px solid rgba(21, 83, 173, 0.16);
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #edf5ff 100%);
    text-align: left;
    box-shadow: var(--nf-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    appearance: none;
}

.dashboard-metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(21, 83, 173, 0.3);
}

.dashboard-metric-card strong {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.05;
    color: var(--nf-secondary);
}

.dashboard-metric-card small,
.dashboard-metric-label,
.dashboard-section-header p,
.dashboard-empty-note,
.dashboard-abc-item small,
.dashboard-client-main small,
.dashboard-detail-item small {
    color: var(--nf-muted);
}

.dashboard-metric-card-alt {
    background: linear-gradient(135deg, #fffdf8 0%, #fff3e6 100%);
}

.dashboard-panel-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.dashboard-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dashboard-bar-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
    min-height: 260px;
}

.dashboard-bar-group {
    display: grid;
    gap: 0.75rem;
}

.dashboard-bar-stack {
    min-height: 210px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.35rem;
    border-radius: 1rem;
    background: #f7fafc;
}

.dashboard-bar {
    width: 0.9rem;
    min-height: 6px;
    border-radius: 999px 999px 0 0;
}

.dashboard-bar-sales {
    background: linear-gradient(180deg, #1553ad 0%, #0f2857 100%);
}

.dashboard-bar-purchases {
    background: linear-gradient(180deg, #ff8a3d 0%, #ff575f 100%);
}

.dashboard-bar-label {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--nf-secondary);
}

.dashboard-abc-list,
.dashboard-top-clients,
.dashboard-detail-list {
    display: grid;
    gap: 0.85rem;
}

.dashboard-abc-item,
.dashboard-client-item,
.dashboard-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--nf-border);
    border-radius: 1rem;
    background: #ffffff;
}

.dashboard-abc-item strong,
.dashboard-client-main strong,
.dashboard-detail-item strong {
    display: block;
    color: var(--nf-secondary);
}

.dashboard-abc-meta {
    text-align: right;
}

.dashboard-abc-class {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.dashboard-abc-class-a {
    background: #dcfce7;
    color: #166534;
}

.dashboard-abc-class-b {
    background: #fef3c7;
    color: #92400e;
}

.dashboard-abc-class-c {
    background: #fee2e2;
    color: #991b1b;
}

.dashboard-client-item {
    gap: 1.25rem;
}

.dashboard-client-rank {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--nf-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.dashboard-client-main {
    flex: 1;
    min-width: 0;
}

.dashboard-client-value,
.dashboard-detail-value {
    font-weight: 800;
    color: var(--nf-secondary);
    text-align: right;
}

.dashboard-empty-note {
    padding: 1rem;
    border-radius: 1rem;
    background: #f8fafc;
}

.sale-items-table {
    table-layout: fixed;
    width: 100%;
}

.sale-items-table .sale-col-product {
    width: 32%;
}

.sale-items-table .sale-col-emb {
    width: 8%;
}

.sale-items-table .sale-col-qty {
    width: 8%;
}

.sale-items-table .sale-col-price {
    width: 8%;
}

.sale-items-table .sale-col-discount {
    width: 9%;
}

.sale-items-table .sale-col-tax {
    width: 8%;
}

.sale-items-table .sale-col-other {
    width: 8%;
}

.sale-items-table .sale-col-remove {
    width: 5%;
}

.sale-items-table td,
.sale-items-table th {
    vertical-align: middle;
}

.sale-items-table .sale-item-emb,
.sale-items-table .sale-item-qtd,
.sale-items-table .sale-item-preco,
.sale-items-table .sale-item-desconto {
    min-width: 0;
}

.sale-items-footer {
    display: flex;
    justify-content: flex-start;
    margin-top: 1rem;
}

.sale-total-field {
    width: min(280px, 100%);
}

.sale-total-field .form-control[readonly] {
    background: rgba(237, 247, 238, 0.65);
    font-weight: 800;
    color: var(--nf-primary-dark);
}

.sale-tax-autocomplete {
    position: relative;
}

.clients-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 24, 18, 0.48);
    z-index: 2040;
}

.clients-modal {
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.clients-modal-card {
    width: min(980px, 100%);
    max-height: calc(100vh - 3rem);
    overflow: auto;
    background: #ffffff;
}

.certificate-alert-modal-card {
    width: min(34rem, 100%);
}

.clients-modal-open {
    overflow: hidden;
}

.clients-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.clients-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.transport-vehicles-section {
    display: grid;
    gap: 1rem;
}

.transport-vehicles-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.transport-vehicles-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--nf-secondary);
}

.transport-vehicles-copy {
    color: var(--nf-muted);
}

.transport-vehicles-table-wrap {
    border: 1px solid var(--nf-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
}

.transport-vehicles-table th,
.transport-vehicles-table td {
    vertical-align: middle;
}

.transport-vehicles-table td {
    min-width: 120px;
}

.transport-vehicle-uf-input {
    min-width: 72px;
    text-transform: uppercase;
}

.transport-vehicle-delete {
    min-width: 2.25rem;
}

.transport-vehicles-empty td {
    background: rgba(248, 250, 252, 0.8);
}

.clients-addresses-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--nf-border);
}

.clients-addresses-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.clients-addresses-table-wrap {
    border: 1px solid var(--nf-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.88);
}

.clients-address-draft {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--nf-border);
    background: linear-gradient(180deg, rgba(237, 247, 238, 0.55) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.selected-company-chip {
    padding: 1rem 1.2rem;
    border-radius: 1.25rem;
    background: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.16);
}

.selected-company-chip span {
    display: block;
    font-size: 0.84rem;
    color: var(--nf-muted);
}

.selected-company-chip strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--nf-primary-dark);
}

.empty-state-card {
    padding: 2rem;
    border-radius: 1.7rem;
    border: 1px solid var(--nf-border);
    background: linear-gradient(135deg, #ffffff 0%, #edf7ee 100%);
    box-shadow: var(--nf-shadow);
}

.empty-state-card h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--nf-secondary);
}

.empty-state-card p,
.dashboard-data-list {
    color: var(--nf-muted);
    line-height: 1.7;
}

.auth-card h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--nf-secondary);
}

.auth-form {
    display: grid;
    gap: 1.15rem;
}

.step-indicator {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 0.5rem;
}

.step-indicator-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    position: relative;
    text-align: center;
    padding: 0.5rem 0.25rem;
    border: none;
    background: none;
    color: var(--nf-muted);
}

.step-indicator-item::before {
    content: "";
    position: absolute;
    top: 1rem;
    left: 0;
    right: 50%;
    height: 2px;
    background: var(--nf-border, #d8e1ef);
}

.step-indicator-item::after {
    content: "";
    position: absolute;
    top: 1rem;
    left: 50%;
    right: 0;
    height: 2px;
    background: var(--nf-border, #d8e1ef);
}

.step-indicator-item:first-child::before,
.step-indicator-item:last-child::after {
    display: none;
}

.step-indicator-item.is-active::before,
.step-indicator-item.is-complete::before,
.step-indicator-item.is-complete::after {
    background: var(--nf-primary, #198754);
}

.step-indicator-item.is-active + .step-indicator-item::before {
    background: var(--nf-primary, #198754);
}

.step-indicator-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(12, 92, 57, 0.08);
    font-weight: 800;
}

.step-indicator-item strong {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    max-width: 100px;
}

.step-indicator-item.is-active {
    color: var(--nf-primary-dark);
}

.step-indicator-item.is-active span,
.step-indicator-item.is-complete span {
    background: var(--nf-primary);
    color: #fff;
}

.step-indicator-item.is-complete {
    color: var(--nf-secondary);
}

.form-section {
    display: none;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--nf-border);
    background: linear-gradient(180deg, rgba(237, 247, 238, 0.55) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.form-section.is-active {
    display: grid;
}

.form-section-header h3 {
    margin: 0.85rem 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--nf-secondary);
}

.form-section-header p {
    margin: 0;
    color: var(--nf-muted);
    line-height: 1.7;
}

.auth-grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-grid-span-2 {
    grid-column: 1 / -1;
}

.company-series-field {
    max-width: 220px;
}

.company-excesso-field-month {
    max-width: 180px;
}

.company-excesso-field-year {
    max-width: 180px;
}

.company-excesso-field-rate {
    max-width: 220px;
}

.auth-textarea {
    min-height: 140px;
    resize: vertical;
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: flex-start;
}

.auth-text-link {
    color: var(--nf-primary-dark);
    font-weight: 700;
}

.form-control,
.form-control:focus {
    border-color: rgba(12, 92, 57, 0.16);
    box-shadow: none;
}

.form-feedback {
    margin-top: 0.45rem;
    font-size: 0.92rem;
    color: var(--nf-muted);
}

.form-feedback.is-success {
    color: var(--nf-primary-dark);
}

.form-feedback.is-error {
    color: #b02a37;
}

.form-feedback.is-loading {
    color: #8a6d1d;
}

.step-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.25rem;
}

.plan-highlight-card,
.plan-includes-card {
    padding: 1.35rem 1.4rem;
    border-radius: 1.4rem;
    border: 1px solid var(--nf-border);
    background: rgba(255, 255, 255, 0.92);
}

.plan-highlight-card {
    background: linear-gradient(135deg, rgba(15, 40, 87, 0.96) 0%, rgba(21, 83, 173, 0.94) 100%);
    color: #f5f9ff;
}

.plan-highlight-card strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
}

.plan-highlight-card p {
    margin: 0.6rem 0 0;
    color: rgba(245, 249, 255, 0.84);
    line-height: 1.7;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.plan-option-card {
    position: relative;
    display: grid;
    gap: 0.85rem;
    padding: 1.4rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(21, 83, 173, 0.14);
    background: rgba(255, 255, 255, 0.96);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.plan-option-card:hover {
    transform: translateY(-2px);
    border-color: rgba(21, 83, 173, 0.3);
    box-shadow: 0 18px 36px rgba(15, 40, 87, 0.1);
}

.plan-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plan-option-card.is-selected {
    border-color: rgba(21, 83, 173, 0.45);
    box-shadow: 0 20px 42px rgba(21, 83, 173, 0.16);
    background: linear-gradient(180deg, rgba(237, 244, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.plan-option-card.is-invalid {
    border-color: rgba(176, 42, 55, 0.45);
}

.plan-option-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.plan-option-name {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--nf-secondary);
}

.plan-option-price {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    color: var(--nf-primary-dark);
    text-align: right;
}

.plan-option-meta {
    color: var(--nf-muted);
    line-height: 1.7;
}

.plan-option-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 87, 95, 0.14);
    color: var(--nf-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.company-creation-status {
    display: grid;
    gap: 1.25rem;
    justify-items: center;
    padding: 1rem 0 0.25rem;
}

.company-creation-spinner {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    border: 4px solid rgba(13, 110, 253, 0.14);
    border-top-color: #0d6efd;
    animation: company-creation-spin 0.9s linear infinite;
}

.company-creation-steps {
    width: 100%;
    display: grid;
    gap: 0.65rem;
}

.company-creation-steps li {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 0.95rem;
    padding: 0.85rem 1rem;
    color: #475569;
    background: #f8fafc;
    font-weight: 600;
}

.company-creation-steps li.is-active {
    border-color: rgba(13, 110, 253, 0.32);
    background: rgba(13, 110, 253, 0.08);
    color: #0f172a;
}

.company-creation-steps li.is-complete {
    border-color: rgba(25, 135, 84, 0.26);
    background: rgba(25, 135, 84, 0.08);
    color: #166534;
}

@keyframes company-creation-spin {
    to {
        transform: rotate(360deg);
    }
}

.sale-client-autocomplete {
    position: relative;
}

.sale-client-suggestions,
.sale-product-suggestions,
.sale-tax-suggestions {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    z-index: 30;
    border: 1px solid var(--nf-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 36px rgba(16, 46, 33, 0.12);
    overflow: hidden;
    max-height: 20rem;
    overflow-y: auto;
}

.sale-client-suggestion,
.sale-product-suggestion,
.sale-tax-suggestion {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 0;
    border-bottom: 1px solid rgba(12, 92, 57, 0.08);
    background: transparent;
    color: var(--nf-secondary);
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sale-client-suggestion:last-child,
.sale-product-suggestion:last-child,
.sale-tax-suggestion:last-child {
    border-bottom: 0;
}

.sale-client-suggestion:hover,
.sale-product-suggestion:hover,
.sale-tax-suggestion:hover {
    background: rgba(25, 135, 84, 0.08);
}

.sale-client-suggestion strong,
.sale-client-suggestion small,
.sale-product-suggestion strong,
.sale-product-suggestion small,
.sale-tax-suggestion strong,
.sale-tax-suggestion small {
    display: block;
}

.sale-client-suggestion-main,
.sale-product-suggestion-main,
.sale-tax-suggestion-main {
    min-width: 0;
}

.sale-client-suggestion-main strong,
.sale-product-suggestion-main strong,
.sale-tax-suggestion-main strong {
    line-height: 1.25;
}

.sale-client-suggestion-main small,
.sale-product-suggestion-main small,
.sale-tax-suggestion-main small {
    display: block;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.sale-client-suggestion-meta,
.sale-product-suggestion-meta,
.sale-tax-suggestion-meta {
    flex-shrink: 0;
    text-align: right;
}

.sale-client-suggestion-meta small + small,
.sale-product-suggestion-meta small + small,
.sale-tax-suggestion-meta small + small {
    margin-top: 0.25rem;
}

.sale-client-suggestion small,
.sale-product-suggestion small,
.sale-tax-suggestion small {
    color: var(--nf-muted);
}

.sale-product-autocomplete {
    position: relative;
    min-width: 0;
}

.sale-product-suggestions {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin-top: 0.45rem;
}

.sale-item-remove-icon {
    min-width: 2.5rem;
    font-size: 1rem;
    line-height: 1;
}

.sale-header-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.sale-col-note-number {
    grid-column: 1 / -1;
}

.sale-col-date {
    grid-column: span 6;
}

.sale-col-document {
    grid-column: span 6;
}

.sale-col-name {
    grid-column: span 6;
}

.sale-col-feedback,
.sale-col-observation {
    grid-column: 1 / -1;
}

.sale-submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    padding: 1rem 0 0;
    margin-top: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 251, 245, 0), rgba(255, 251, 245, 0.96) 28%, rgba(255, 251, 245, 1) 100%);
}

.sale-tax-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(15, 23, 42, 0.04));
    border: 1px solid rgba(13, 110, 253, 0.12);
}

.sale-tax-tab {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.82);
    color: #334155;
    border-radius: 999px;
    padding: 0.8rem 1.15rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sale-tax-tab:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(13, 110, 253, 0.2);
    transform: translateY(-1px);
}

.sale-tax-tab:focus-visible {
    outline: none;
    border-color: rgba(13, 110, 253, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.sale-tax-tab.is-active {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border-color: rgba(10, 88, 202, 0.75);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.22);
}

.sale-tax-panel {
    display: none;
}

.sale-tax-panel.is-active {
    display: block;
    padding: 1.1rem;
    border-radius: 1rem;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sale-tax-panel-plain.is-active {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .auth-layout,
    .auth-layout-wide {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
        position: relative;
    }

    .sidebar-card {
        min-height: calc(100vh - 8rem);
    }

    .dashboard-layout.dashboard-with-toggle .sidebar-card {
        position: fixed;
        top: 5.75rem;
        left: 50%;
        bottom: auto;
        width: min(22rem, calc(100vw - 2rem));
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 7rem);
        overflow-y: auto;
        z-index: 1200;
        background: #ffffff;
        transform: translate(-50%, 1rem) scale(0.96);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .dashboard-layout.dashboard-with-toggle .sidebar-card.is-mobile-open {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(15, 40, 87, 0.38);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.22s ease, visibility 0.22s ease;
        z-index: 1100;
    }

    .sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }

    .clients-search-bar {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-grid,
    .dashboard-panel-grid,
    .dashboard-metric-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-section-header {
        flex-direction: column;
    }

    .auth-aside,
    .auth-card {
        padding: 1.5rem;
    }

    .step-indicator {
        gap: 0;
    }

    .step-indicator-item strong {
        font-size: 0.68rem;
        max-width: 70px;
    }

    .sale-col-date,
    .sale-col-document,
    .sale-col-name {
        grid-column: span 6;
    }

    .sale-col-note-number {
        grid-column: 1 / -1;
    }

    .sale-tax-tabs {
        gap: 0.4rem;
    }

    .sale-tax-tab {
        flex: 1 1 calc(50% - 0.4rem);
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 767.98px) {
    .dashboard-topbar {
        justify-content: space-between;
    }

    .dashboard-custom-range {
        grid-template-columns: 1fr;
    }

    .dashboard-bar-chart {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .dashboard-abc-item,
    .dashboard-client-item,
    .dashboard-detail-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-abc-meta,
    .dashboard-client-value,
    .dashboard-detail-value {
        text-align: left;
    }

    .auth-grid-form {
        grid-template-columns: 1fr;
    }

    .plan-grid {
        grid-template-columns: 1fr;
    }

    .plan-option-top {
        flex-direction: column;
    }

    .plan-option-price {
        text-align: left;
    }

    .sale-header-grid {
        grid-template-columns: 1fr;
    }

    .sale-col-note-number,
    .sale-col-date,
    .sale-col-document,
    .sale-col-name,
    .sale-col-feedback,
    .sale-col-observation {
        grid-column: 1;
    }

    .sale-submit-bar {
        padding-top: 0.75rem;
    }

    .sale-tax-tabs {
        padding: 0.3rem;
    }

    .sale-tax-tab {
        flex: 1 1 100%;
    }

    .sale-tax-panel.is-active {
        padding: 0.9rem;
    }

    .sale-tax-panel-plain.is-active {
        padding: 0;
    }
}

/* ── Responsive clients / cadastros tables ────────────────────────── */

@media (max-width: 991.98px) {
    .clients-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-card-header .btn,
    .clients-card-header .clients-create-button {
        width: 100%;
        text-align: center;
    }

    .clients-table-wrap {
        height: calc(100vh - 280px);
        min-height: 180px;
        max-height: none;
    }

    .clients-modal-card {
        width: min(96vw, 100%);
        max-height: calc(100vh - 2rem);
    }

    .clients-modal {
        padding: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .dashboard-card,
    .dashboard-layout > .dashboard-card {
        padding: 0.75rem;
    }

    .clients-table-wrap,
    .table-responsive {
        width: 100%;
        overflow-x: hidden;
    }

    .clients-table,
    .sale-items-table {
        width: 100% !important;
        table-layout: auto !important;
    }

    .clients-table thead {
        display: none;
    }

    .clients-table tbody td {
        display: block;
        padding: 0.15rem 0;
        border: none;
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .clients-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        color: #7b8da4;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 0.1rem;
    }

    .clients-empty-state td {
        grid-column: 1 / -1;
    }

    .clients-empty-state td::before {
        display: none;
    }

    /* ── Clientes: card layout ── */
    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 0;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--nf-border, #d8e1ef);
    }

    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row):hover {
        background: rgba(21, 83, 173, 0.04);
    }

    /* Codigo: col 1, row 1 */
    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        font-size: 0.78rem;
        color: #7b8da4;
    }

    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(1)::before {
        display: inline;
        margin-right: 0.3rem;
    }

    /* Nome: col 1, row 2 — negrito */
    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        font-weight: 700;
        font-size: 0.95rem;
    }

    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(2)::before {
        display: none;
    }

    /* Documento: col 1, row 3 */
    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
        font-size: 0.82rem;
        color: #526277;
    }

    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(3)::before {
        display: inline;
        margin-right: 0.3rem;
    }

    /* Cidade, UF: ocultos */
    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(4),
    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(5) {
        display: none;
    }

    /* Excluir: col 2, centralizado verticalmente com toda a altura */
    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(6) {
        grid-column: 2;
        grid-row: 1 / 4;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 0 0 0.5rem;
    }

    .clients-table tbody tr.clients-row:not(.product-row):not(.transport-row):not(.sales-row) > td:nth-child(6)::before {
        display: none;
    }

    /* ── Produtos / Transportadoras / Vendas: layout card generico ── */
    /* ── Produtos: card layout ── */
    .clients-table tbody tr.product-row {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: start;
        gap: 0;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--nf-border, #d8e1ef);
    }

    .clients-table tbody tr.product-row:hover {
        background: rgba(21, 83, 173, 0.04);
    }

    /* Codigo: col 1, row 1 */
    .clients-table tbody tr.product-row > td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        font-size: 0.78rem;
        color: #7b8da4;
    }

    .clients-table tbody tr.product-row > td:nth-child(1)::before {
        display: inline;
        margin-right: 0.3rem;
    }

    /* Descricao: col 1, row 2 — negrito */
    .clients-table tbody tr.product-row > td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        font-weight: 700;
        font-size: 0.95rem;
    }

    .clients-table tbody tr.product-row > td:nth-child(2)::before {
        display: none;
    }

    /* Preco: col 1, row 3 */
    .clients-table tbody tr.product-row > td:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
        font-size: 0.82rem;
        color: #526277;
    }

    .clients-table tbody tr.product-row > td:nth-child(3)::before {
        display: inline;
        margin-right: 0.3rem;
    }

    /* NCM: oculto */
    .clients-table tbody tr.product-row > td:nth-child(4) {
        display: none;
    }

    /* Tributos: col 2, row 1 (topo direito) */
    .clients-table tbody tr.product-row > td:nth-child(5) {
        grid-column: 2;
        grid-row: 1 / 2;
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        padding: 0 0 0.25rem 0.5rem;
    }

    .clients-table tbody tr.product-row > td:nth-child(5)::before {
        display: none;
    }

    /* Excluir: col 2, row 2-3 (abaixo de tributos, direita) */
    .clients-table tbody tr.product-row > td:nth-child(6) {
        grid-column: 2;
        grid-row: 2 / 4;
        display: flex;
        align-items: flex-end;
        justify-content: flex-end;
        padding: 0.25rem 0 0 0.5rem;
    }

    .clients-table tbody tr.product-row > td:nth-child(6)::before {
        display: none;
    }

    /* ── Transportadoras: card layout ── */
    .clients-table tbody tr.transport-row {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 0;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--nf-border, #d8e1ef);
    }

    .clients-table tbody tr.transport-row:hover {
        background: rgba(21, 83, 173, 0.04);
    }

    /* Codigo: col 1, row 1 */
    .clients-table tbody tr.transport-row > td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        font-size: 0.78rem;
        color: #7b8da4;
    }

    .clients-table tbody tr.transport-row > td:nth-child(1)::before {
        display: inline;
        margin-right: 0.3rem;
    }

    /* Transportadora (descricao): col 1, row 2 — negrito */
    .clients-table tbody tr.transport-row > td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        font-weight: 700;
        font-size: 0.95rem;
    }

    .clients-table tbody tr.transport-row > td:nth-child(2)::before {
        display: none;
    }

    /* Documento: col 1, row 3 */
    .clients-table tbody tr.transport-row > td:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
        font-size: 0.82rem;
        color: #526277;
    }

    .clients-table tbody tr.transport-row > td:nth-child(3)::before {
        display: inline;
        margin-right: 0.3rem;
    }

    /* Cidade, UF, Veiculos: ocultos */
    .clients-table tbody tr.transport-row > td:nth-child(4),
    .clients-table tbody tr.transport-row > td:nth-child(5),
    .clients-table tbody tr.transport-row > td:nth-child(6) {
        display: none;
    }

    /* Excluir: col 2, centralizado verticalmente */
    .clients-table tbody tr.transport-row > td:nth-child(7) {
        grid-column: 2;
        grid-row: 1 / 4;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 0 0 0.5rem;
    }

    .clients-table tbody tr.transport-row > td:nth-child(7)::before {
        display: none;
    }

    /* ── Vendas: card layout ── */
    .clients-table tbody tr.sales-row {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 0.75rem 5rem 0.75rem 1rem;
        border-bottom: 1px solid var(--nf-border, #d8e1ef);
        position: relative;
    }

    .clients-table tbody tr.sales-row:hover {
        background: rgba(21, 83, 173, 0.04);
    }

    .clients-table tbody tr.sales-row > td {
        padding: 0;
        border: none;
    }

    .clients-table tbody tr.sales-row > td::before {
        display: none;
    }

    /* Row 1: Data + Numero */
    .clients-table tbody tr.sales-row > td:nth-child(2) {
        order: 1;
        font-size: 0.82rem;
        color: #526277;
    }

    .clients-table tbody tr.sales-row > td:nth-child(1) {
        order: 2;
        font-size: 0.82rem;
        color: #7b8da4;
        margin-left: 0.4rem;
    }

    /* Row 2: Cliente */
    .clients-table tbody tr.sales-row > td:nth-child(3) {
        order: 3;
        flex-basis: 100%;
        font-weight: 700;
        font-size: 0.95rem;
        padding: 0.15rem 0;
    }

    /* Row 3: Valor + Status */
    .clients-table tbody tr.sales-row > td:nth-child(4) {
        order: 4;
        font-size: 0.85rem;
        color: #526277;
    }

    .clients-table tbody tr.sales-row > td:nth-child(5) {
        order: 5;
        font-size: 0.82rem;
        margin-left: 0.4rem;
    }

    /* Botoes: coluna direita, posicao absoluta */
    .clients-table tbody tr.sales-row > td.sales-cell-more {
        order: 10;
        position: absolute;
        top: 0.75rem;
        right: 1rem;
    }

    .clients-table tbody tr.sales-row > td.sales-cell-action {
        order: 11;
        position: absolute;
        bottom: 0.75rem;
        right: 1rem;
    }

    .table-loading-row td,
    .table-skeleton-row td {
        grid-column: 1 / -1;
    }

    .table-loading-row td::before,
    .table-skeleton-row td::before {
        display: none;
    }

    .clients-table-wrap {
        border-radius: 0.75rem;
        height: calc(100vh - 240px);
        min-height: 180px;
        max-height: none;
    }

    .clients-search-bar {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .clients-search-field {
        max-width: none;
    }

    .clients-delete-button,
    .product-tax-button {
        min-height: 2.2rem;
        min-width: 2.2rem;
        font-size: 1rem;
    }

    .clients-modal-form .row {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.65rem;
    }

    .clients-modal-actions {
        flex-direction: column;
    }

    .clients-modal-actions .btn {
        width: 100%;
    }

    .sales-filters-panel .sales-filter-input-row,
    .sales-filter-group {
        flex-direction: column;
    }

    .sales-filter-group > * {
        flex: 1 1 100% !important;
        max-width: none !important;
    }

    .sales-row {
        grid-template-columns: 1fr 1fr;
    }

    .sales-row td[data-label="Acao"],
    .sales-row td[data-label=""] {
        grid-column: auto;
    }

    .sales-row td:nth-last-child(-n+4) {
        grid-column: auto;
    }

    .sales-row td:last-child {
        grid-column: auto;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .clients-table tbody tr {
        grid-template-columns: 1fr;
    }

    .dashboard-card,
    .dashboard-layout > .dashboard-card {
        padding: 1rem;
    }

    .clients-card-header h1 {
        font-size: 1.35rem;
    }

    .clients-modal-card {
        border-radius: 1rem;
        padding: 1.15rem;
    }

    .clients-modal-header h3 {
        font-size: 1.1rem;
    }
}

/* ── Sale items card layout (mobile) ────────────────────────────── */
@media (max-width: 767.98px) {
    .sale-items-table {
        table-layout: auto !important;
        width: 100% !important;
        display: block;
    }

    .sale-items-table tbody {
        display: block;
        width: 100%;
    }

    .sale-items-table thead {
        display: none;
    }

    .sale-items-table colgroup,
    .sale-items-table col {
        display: none;
    }

    .sale-items-table .sale-col-product,
    .sale-items-table .sale-col-emb,
    .sale-items-table .sale-col-qty,
    .sale-items-table .sale-col-price,
    .sale-items-table .sale-col-discount,
    .sale-items-table .sale-col-tax,
    .sale-items-table .sale-col-other,
    .sale-items-table .sale-col-remove {
        width: auto !important;
    }

    .sale-items-table tbody tr[data-sale-index] {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        column-gap: 0.5rem;
        row-gap: 0.3rem;
        padding: 0.65rem 0.5rem;
        border-bottom: 1px solid var(--nf-border, #d8e1ef);
    }

    .sale-items-table tbody tr[data-sale-index] > td {
        padding: 0;
        border: none;
        min-width: 0;
    }

    /* Esconder inputs inline: emb, qtd, preco, desconto */
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(2),
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(3),
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(4),
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(5) {
        display: none !important;
    }

    /* Produto: col 1, row 1 */
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .sale-items-table tbody tr[data-sale-index] > td:nth-child(1) .sale-item-product-search {
        width: 100%;
        font-size: 0.88rem;
    }

    /* Summary mobile: col 1, rows 2-3 */
    .sale-item-mobile-summary {
        display: flex !important;
        flex-direction: column;
        gap: 0.15rem;
        grid-column: 1;
        grid-row: 2 / 4;
        cursor: pointer;
        padding: 0.4rem 0.5rem !important;
        border-radius: 0.5rem;
        background: rgba(21, 83, 173, 0.04);
        transition: background 0.15s ease;
    }

    .sale-item-mobile-summary:hover,
    .sale-item-mobile-summary:active {
        background: rgba(21, 83, 173, 0.09);
    }

    .sale-mobile-line1 {
        font-size: 0.85rem;
        color: #526277;
        font-weight: 600;
    }

    .sale-mobile-line2 {
        font-size: 0.8rem;
        color: #7b8da4;
    }

    .sale-mobile-line3 {
        font-size: 0.88rem;
        font-weight: 700;
        color: #17324d;
    }

    /* Tributos: col 2, row 1 */
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(6) {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    /* Outros: col 2, row 2 */
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(7) {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    /* Excluir: col 2, row 3 */
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(8) {
        grid-column: 2;
        grid-row: 3;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .sale-items-table tbody tr[data-sale-index] > td:nth-child(6) .btn,
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(7) .btn,
    .sale-items-table tbody tr[data-sale-index] > td:nth-child(8) .btn {
        font-size: 0.72rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }

    .sale-items-table .clients-empty-state td {
        grid-column: 1 / -1;
    }
}

/* Ocultar summary no desktop */
.sale-item-mobile-summary {
    display: none;
}

body.sidebar-lock-scroll {
    overflow: hidden;
}
