:root {
    --ifmt-green-950: #061a11;
    --ifmt-green-900: #0b281a;
    --ifmt-green-800: #123d29;
    --ifmt-green-700: #17613d;
    --ifmt-green-600: #198754;
    --ifmt-green-500: #24a865;
    --ifmt-green-100: #dff3e7;
    --ifmt-green-50: #f0f9f4;
    --ifmt-ink: #17231c;
    --ifmt-muted: #66746c;
    --ifmt-border: #dfe7e2;
    --ifmt-border-soft: #ebf0ed;
    --ifmt-canvas: #f3f6f4;
    --ifmt-surface: #ffffff;
    --ifmt-danger: #b42318;
    --ifmt-warning: #b54708;
    --ifmt-info: #175cd3;
    --ifmt-radius-sm: 8px;
    --ifmt-radius: 12px;
    --ifmt-radius-lg: 16px;
    --ifmt-shadow-sm: 0 2px 8px rgba(10, 35, 22, .05);
    --ifmt-shadow: 0 10px 30px rgba(10, 35, 22, .07);
    --bs-primary: #17613d;
    --bs-primary-rgb: 23, 97, 61;
    --bs-success: #198754;
    --bs-success-rgb: 25, 135, 84;
    --bs-link-color: #17613d;
    --bs-link-hover-color: #0f4b2e;
    --bs-border-color: #dfe7e2;
    --bs-body-color: #26332b;
    --bs-body-bg: #f3f6f4;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    color: var(--ifmt-ink);
    background:
        radial-gradient(circle at 92% 0, rgba(36, 168, 101, .055), transparent 28rem),
        var(--ifmt-canvas);
    font-size: .9375rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.wrapper {
    display: block !important;
    width: 100%;
}

a {
    text-underline-offset: .16em;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ifmt-ink);
    font-weight: 720;
    letter-spacing: -.018em;
}

.sidebar {
    width: 252px !important;
    background:
        radial-gradient(circle at 15% -5%, rgba(63, 190, 116, .18), transparent 18rem),
        var(--ifmt-green-950) !important;
    border-right: 1px solid rgba(255, 255, 255, .07) !important;
    box-shadow: 10px 0 35px rgba(6, 26, 17, .08);
    z-index: 1030;
}

.sidebar-brand {
    align-items: center;
    display: flex;
    gap: .75rem;
    min-height: 74px;
    padding: 15px 14px !important;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(145deg, #3bc879, #16814f);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 12px;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .18);
    color: white;
    display: inline-flex;
    flex: 0 0 40px;
    font-size: 1.15rem;
    height: 40px;
    justify-content: center;
}

.sidebar-brand .brand-title {
    font-size: .9rem !important;
    letter-spacing: -.01em;
}

.sidebar-brand .brand-subtitle {
    color: #93d8ae !important;
    font-size: .7rem !important;
}

.menu-principal {
    padding: 8px 9px 14px !important;
}

.menu-list {
    margin: 0;
    padding: 0 !important;
}

.menu-section {
    color: #72c994 !important;
    font-size: .62rem !important;
    letter-spacing: .13em !important;
    margin: 0 9px;
    padding: 18px 2px 7px !important;
}

.menu-link {
    border: 1px solid transparent;
    border-radius: 9px !important;
    color: #cbd8d0 !important;
    font-size: .84rem !important;
    font-weight: 540;
    gap: 9px !important;
    margin-bottom: 2px !important;
    min-height: 39px;
    padding: 8px 10px !important;
    position: relative;
}

.menu-link i {
    color: #91a99b !important;
    font-size: .94rem !important;
    transition: color .16s ease, transform .16s ease;
}

.menu-link:hover {
    background: rgba(255, 255, 255, .065) !important;
    border-color: rgba(255, 255, 255, .055);
    color: #fff !important;
}

.menu-link:hover i {
    color: #8fe0ad !important;
    transform: translateX(1px);
}

.menu-link.active,
.menu-link[aria-current="page"] {
    background: linear-gradient(100deg, rgba(37, 170, 99, .25), rgba(37, 170, 99, .08)) !important;
    border-color: rgba(85, 207, 137, .2);
    color: #fff !important;
    font-weight: 680;
}

.menu-link.active::before,
.menu-link[aria-current="page"]::before {
    background: #53d48b;
    border-radius: 0 5px 5px 0;
    content: "";
    height: 20px;
    left: -10px;
    position: absolute;
    top: 9px;
    width: 3px;
}

.menu-link.active i,
.menu-link[aria-current="page"] i {
    color: #71dfa0 !important;
}

.user-info {
    background: rgba(255, 255, 255, .035) !important;
    border-top-color: rgba(255, 255, 255, .08) !important;
    padding: 12px 13px !important;
}

.user-avatar {
    align-items: center;
    background: rgba(48, 187, 108, .15);
    border: 1px solid rgba(91, 211, 143, .2);
    border-radius: 50%;
    color: #8ee0ae;
    display: inline-flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
}

.main-content {
    background: transparent !important;
    margin-left: 252px !important;
    max-width: calc(100% - 252px);
    min-width: 0;
    width: calc(100% - 252px);
}

.main-content > main {
    padding: clamp(18px, 2.4vw, 34px) !important;
    width: 100%;
}

.main-content > footer {
    background: rgba(255, 255, 255, .55) !important;
    border-top: 1px solid var(--ifmt-border-soft) !important;
    color: var(--ifmt-muted);
}

.container {
    max-width: 1320px;
}

.card,
.integration-panel,
.integration-card,
.integration-kpi {
    border-color: var(--ifmt-border) !important;
    box-shadow: var(--ifmt-shadow-sm);
}

.card {
    --bs-card-border-radius: var(--ifmt-radius-lg);
    --bs-card-inner-border-radius: calc(var(--ifmt-radius-lg) - 1px);
}

.shadow-sm {
    box-shadow: var(--ifmt-shadow-sm) !important;
}

.shadow {
    box-shadow: var(--ifmt-shadow) !important;
}

.rounded-4 {
    border-radius: var(--ifmt-radius-lg) !important;
}

.btn {
    --bs-btn-border-radius: 9px;
    align-items: center;
    display: inline-flex;
    font-weight: 650;
    gap: .15rem;
    justify-content: center;
    letter-spacing: -.006em;
    min-height: 38px;
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
}

.btn-sm {
    --bs-btn-border-radius: 8px;
    min-height: 32px;
}

.btn-lg {
    --bs-btn-border-radius: 11px;
    min-height: 46px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary {
    --bs-btn-bg: var(--ifmt-green-700);
    --bs-btn-border-color: var(--ifmt-green-700);
    --bs-btn-hover-bg: #104f31;
    --bs-btn-hover-border-color: #104f31;
    --bs-btn-active-bg: #0c4329;
    --bs-btn-active-border-color: #0c4329;
}

.btn-outline-primary {
    --bs-btn-color: var(--ifmt-green-700);
    --bs-btn-border-color: #82b99a;
    --bs-btn-hover-bg: var(--ifmt-green-700);
    --bs-btn-hover-border-color: var(--ifmt-green-700);
}

.form-control,
.form-select,
.input-group-text {
    border-color: #d6e0da;
    border-radius: 10px;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #64af83;
    box-shadow: 0 0 0 .22rem rgba(25, 135, 84, .12);
}

.form-label {
    color: #34443a;
    font-size: .84rem;
    font-weight: 680;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text,
.input-group > .btn {
    min-height: 42px;
}

.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
    min-height: 32px;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(25, 135, 84, .035);
    border-color: var(--ifmt-border-soft);
    color: #2b382f;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: .82rem .78rem;
}

.table thead th,
.table-light th {
    background: #f1f6f3 !important;
    border-bottom-color: #dbe6df;
    color: #53635a;
    font-size: .72rem;
    font-weight: 780;
    letter-spacing: .045em;
    text-transform: uppercase;
    vertical-align: middle;
}

.table-responsive {
    max-width: 100%;
    scrollbar-color: #b5c8bc transparent;
    scrollbar-width: thin;
}

.badge {
    font-weight: 680;
    letter-spacing: .005em;
}

.alert {
    border-radius: var(--ifmt-radius);
    border-width: 1px;
}

.modal.show {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.modal-dialog {
    margin-top: 1.25rem;
    overflow: initial !important;
}

.modal-content {
    border: 1px solid rgba(10, 35, 22, .09) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 70px rgba(6, 26, 17, .2) !important;
}

.modal-header,
.modal-footer {
    border-color: var(--ifmt-border-soft);
}

.dropdown-menu {
    border-color: var(--ifmt-border);
    border-radius: 12px;
    box-shadow: var(--ifmt-shadow);
    padding: .4rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: .5rem .65rem;
}

.pagination {
    --bs-pagination-border-color: var(--ifmt-border);
    --bs-pagination-color: var(--ifmt-green-700);
    --bs-pagination-active-bg: var(--ifmt-green-700);
    --bs-pagination-active-border-color: var(--ifmt-green-700);
    gap: .25rem;
}

.page-link {
    border-radius: 8px !important;
}

.nav-tabs {
    border-bottom-color: var(--ifmt-border);
}

.nav-tabs .nav-link {
    border-radius: 9px 9px 0 0;
    color: var(--ifmt-muted);
    font-weight: 650;
}

.nav-tabs .nav-link.active {
    color: var(--ifmt-green-700);
}

.empty-state,
.integration-empty {
    background: rgba(255, 255, 255, .72) !important;
    border-color: #bfd0c5 !important;
}

.page-header {
    align-items: flex-end;
    border-bottom: 1px solid var(--ifmt-border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.35rem;
    padding-bottom: 1.1rem;
}

.page-header > * {
    min-width: 0;
}

.page-eyebrow {
    color: var(--ifmt-green-600);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .105em;
    margin-bottom: .3rem;
    text-transform: uppercase;
}

.page-title {
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    margin: 0;
}

.page-subtitle {
    color: var(--ifmt-muted);
    margin: .3rem 0 0;
}

.metric-card {
    background: var(--ifmt-surface);
    border: 1px solid var(--ifmt-border);
    border-radius: var(--ifmt-radius);
    box-shadow: var(--ifmt-shadow-sm);
    height: 100%;
    padding: 1rem;
}

.metric-label {
    color: var(--ifmt-muted);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.metric-value {
    color: var(--ifmt-ink);
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: .25rem;
}

/* Compatibilidade visual para módulos com estilos próprios legados. */
.dashboard-bg,
.pagamentos-bg {
    background: transparent !important;
}

.glass-card,
.request-card,
.task-card,
.kanban-col {
    border-color: var(--ifmt-border) !important;
    box-shadow: var(--ifmt-shadow-sm) !important;
}

.glass-card {
    background: rgba(255, 255, 255, .94) !important;
    backdrop-filter: none !important;
}

.fleet-title,
.vehicle-name {
    color: var(--ifmt-ink) !important;
}

.fleet-eyebrow {
    color: var(--ifmt-green-600) !important;
}

.status-tab.active {
    background: var(--ifmt-green-700) !important;
    border-color: var(--ifmt-green-700) !important;
}

.travel-period,
.kanban-col {
    background: #f0f5f2 !important;
}

.task-card.border-accent-primary {
    border-left-color: var(--ifmt-green-600) !important;
}

@media (max-width: 767.98px) {
    .mobile-navbar {
        background: var(--ifmt-green-950) !important;
        box-shadow: 0 5px 18px rgba(6, 26, 17, .15);
        min-height: 58px;
        position: sticky;
        top: 0;
        z-index: 1025;
    }

    .mobile-sidebar {
        background: var(--ifmt-green-950) !important;
        width: min(88vw, 320px) !important;
    }

    .main-content {
        margin-left: 0 !important;
        max-width: 100%;
        width: 100%;
    }

    .main-content > main {
        padding: 16px 12px 24px !important;
    }

    .container,
    .container-fluid {
        --bs-gutter-x: 1.25rem;
    }

    h1, .h1 { font-size: 1.65rem; }
    h2, .h2 { font-size: 1.4rem; }

    .card-body {
        padding: 1rem;
    }

    .table > :not(caption) > * > * {
        padding: .68rem .62rem;
    }

    .modal-dialog {
        margin: .65rem;
    }

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

    .page-header .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
