@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800&display=swap");

:root {
    --color-primary: #47126b;
    --color-secondary: #6411ad;
    --color-white: #ffffff;
    --color-background: #fffefb;
    --background-grey: #f2f3f7;
}

/* =====================================================
   CORREÇÃO CRÍTICA: COMPORTAMENTO DE APP MOBILE
   Força viewport correto e previne zoom indesejado
   ===================================================== */

/* Previne scroll horizontal e força largura correta */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

/* Previne zoom em inputs no iOS (font-size >= 16px) */
@media screen and (max-width: 991px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="search"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

p,
span,
h1,
h2,
h3,
h4,
h5,
a,
button,
input,
optgroup,
select,
textarea,
ul,
li,
body,
html {
    /* font-family: "Montserrat" !important; */
}

select {
    /* -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none; */
}

input:focus,
select:focus,
textarea:focus,
.dropdown .bootstrap-select .form-control .picker:focus {
    border-color: var(--color-secondary) !important;
}

input.form-control::placeholder,
.bootstrap-select>.dropdown-toggle.bs-placeholder,
.bootstrap-select>.dropdown-toggle.bs-placeholder:hover {
    color: #3f4254 !important;
}

.bootstrap-select>.dropdown-toggle:focus {
    border-color: #997aaf !important;
}

.btn.btn-success,
.btn.btn-primary {
    color: var(--color-white);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn.btn-success:hover,
.btn.btn-primary:hover {
    background-color: var(--color-secondary) !important;
    border-color: var(--color-secondary) !important;
}

.btn.btn-primary:disabled {
    color: var(--color-white);
    background-color: var(--color-secondary) !important;
    border-color: var(--color-secondary);
}

.btn.btn-hover-primary:not(:disabled):not(.disabled).active {
    color: var(--color-white);
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary);
}

.paginate-item-page.current-page,
.datatable.datatable-default>.datatable-pager>.datatable-pager-nav>li>.datatable-pager-link.datatable-pager-link-active {
    color: var(--color-white);
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary);
}

.form-control {
    border-color: #997aaf;
}

.svg-icon.menu-icon {
    margin: 0 10px 0 0;
}

.svg-icon.menu-icon>i {
    color: white;
}

.nav-link.active>.svg-icon.menu-icon>i {
    color: #47126b;
}

.aside-menu .menu-nav>.menu-item>.menu-link .menu-icon>i,
.aside-menu .menu-nav>.menu-item .menu-submenu .menu-item>.menu-link .menu-icon>i {
    color: var(--color-primary) !important;
}

.symbol.symbol-light-success .symbol-label {
    background-color: var(--color-secondary);
    color: var(--color-primary);
}

.svg-icon.svg-icon-primary svg g [fill] {
    fill: var(--color-primary) !important;
}

.switch.switch-success:not(.switch-outline) .input:checked~span:before {
    background-color: var(--color-primary) !important;
}

.brand-logo img {
    margin-right: 30px;
}

.white-space {
    white-space: nowrap;
}

.menu-text {
    color: #000 !important;
    font-size: 13px !important;
}

.header .header-menu .menu-nav>.menu-item.menu-item-active>.menu-link {
    background-color: #47126b !important;
}

.menu-item.menu-item-active>.menu-link .menu-text {
    color: #47126b !important;
}

.image-list {
    border-radius: 100% !important;
    width: 35px !important;
    height: 35px !important;
    object-fit: cover;
}

/* Tabelas - nowrap aplicado por padrão no mobile, removido em telas maiores */
.table th,
.table td {
    white-space: nowrap;
}

@media screen and (min-width: 992px) {
    .table th,
    .table td {
        white-space: normal;
    }
}

.card-person .d-flex {
    gap: 15px;
}

.badge-light-success {
    color: #50cd89;
    background-color: #e8fff3;
}

.badge-light-secondary {
    color: #7e8299;
    background-color: #f5f8fa;
}

.badge-light-danger {
    color: #f1416c;
    background-color: #fff5f8;
}

.font-weight-extra-bold {
    font-weight: 600;
}

.bg-light-green {
    background: #e9f5db;
}

.text-green {
    color: #718355;
}

.bg-light-blue {
    background: #caf0f8;
}

.text-blue {
    color: #0077b6;
}

.bg-light-purple {
    background: #f2ebfb;
}

.text-yellow {
    color: #ff8100;
}

.badge-primary {
    color: #ffffff;
    background-color: #47126b;
}

a.badge-primary:hover,
a.badge-primary:focus {
    color: #ffffff;
    background-color: #037fff;
}

a.badge-primary:focus,
a.badge-primary.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(54, 153, 255, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(54, 153, 255, 0.5);
}

.badge-secondary {
    color: #181c32;
    background-color: #e4e6ef;
}

a.badge-secondary:hover,
a.badge-secondary:focus {
    color: #181c32;
    background-color: #c4c8dc;
}

a.badge-secondary:focus,
a.badge-secondary.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(228, 230, 239, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(228, 230, 239, 0.5);
}

.badge-success {
    color: #ffffff;
    background-color: #6411ad;
}

a.badge-success:hover,
a.badge-success:focus {
    color: #ffffff;
    background-color: #159892;
}

a.badge-success:focus,
a.badge-success.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(27, 197, 189, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(27, 197, 189, 0.5);
}

.badge-info {
    color: #ffffff;
    background-color: #8950fc;
}

a.badge-info:hover,
a.badge-info:focus {
    color: #ffffff;
    background-color: #671efb;
}

a.badge-info:focus,
a.badge-info.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(137, 80, 252, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(137, 80, 252, 0.5);
}

.badge-warning {
    color: #181c32;
    background-color: #ffa800;
}

a.badge-warning:hover,
a.badge-warning:focus {
    color: #181c32;
    background-color: #cc8600;
}

a.badge-warning:focus,
a.badge-warning.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(255, 168, 0, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(255, 168, 0, 0.5);
}

.badge-danger {
    color: #ffffff;
    background-color: #f64e60;
}

a.badge-danger:hover,
a.badge-danger:focus {
    color: #ffffff;
    background-color: #f41d34;
}

a.badge-danger:focus,
a.badge-danger.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(246, 78, 96, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(246, 78, 96, 0.5);
}

.badge-light {
    color: #181c32;
    background-color: #f3f6f9;
}

a.badge-light:hover,
a.badge-light:focus {
    color: #181c32;
    background-color: #d1dde8;
}

a.badge-light:focus,
a.badge-light.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(243, 246, 249, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(243, 246, 249, 0.5);
}

.badge-dark {
    color: #ffffff;
    background-color: #181c32;
}

a.badge-dark:hover,
a.badge-dark:focus {
    color: #ffffff;
    background-color: #070910;
}

a.badge-dark:focus,
a.badge-dark.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(24, 28, 50, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(24, 28, 50, 0.5);
}

.badge-white {
    color: #181c32;
    background-color: #ffffff;
}

a.badge-white:hover,
a.badge-white:focus {
    color: #181c32;
    background-color: #e6e6e6;
}

a.badge-white:focus,
a.badge-white.focus {
    outline: 0;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.5);
}

.label.label-primary {
    color: #ffffff;
    background-color: #47126b;
}

.label.label-outline-primary {
    background-color: transparent;
    color: #47126b;
    border: 1px solid #47126b;
}

.label.label-outline-primary.label-outline-2x {
    border: 2px solid #47126b;
}

.label.label-light-primary {
    color: #47126b;
    background-color: #e1f0ff;
}

.label.label-secondary {
    color: #3f4254;
    background-color: #e4e6ef;
}

.label.label-outline-secondary {
    background-color: transparent;
    color: #3f4254;
    border: 1px solid #e4e6ef;
}

.label.label-outline-secondary.label-outline-2x {
    border: 2px solid #e4e6ef;
}

.label.label-light-secondary {
    color: #e4e6ef;
    background-color: #ebedf3;
}

.label.label-success {
    color: #ffffff;
    background-color: #6411ad;
}

.label.label-outline-success {
    background-color: transparent;
    color: #6411ad;
    border: 1px solid #6411ad;
}

.label.label-outline-success.label-outline-2x {
    border: 2px solid #6411ad;
}

.label.label-light-success {
    color: #6411ad;
    background-color: #c9f7f5;
}

.label.label-info {
    color: #ffffff;
    background-color: #8950fc;
}

.label.label-outline-info {
    background-color: transparent;
    color: #8950fc;
    border: 1px solid #8950fc;
}

.label.label-outline-info.label-outline-2x {
    border: 2px solid #8950fc;
}

.label.label-light-info {
    color: #8950fc;
    background-color: #eee5ff;
}

.label.label-warning {
    color: #ffffff;
    background-color: #ffa800;
}

.label.label-outline-warning {
    background-color: transparent;
    color: #ffa800;
    border: 1px solid #ffa800;
}

.label.label-outline-warning.label-outline-2x {
    border: 2px solid #ffa800;
}

.label.label-light-warning {
    color: #ffa800;
    background-color: #fff4de;
}

.label.label-danger {
    color: #ffffff;
    background-color: #f64e60;
}

.label.label-outline-danger {
    background-color: transparent;
    color: #f64e60;
    border: 1px solid #f64e60;
}

.label.label-outline-danger.label-outline-2x {
    border: 2px solid #f64e60;
}

.label.label-light-danger {
    color: #f64e60;
    background-color: #ffe2e5;
}

.label.label-light {
    color: #7e8299;
    background-color: #f3f6f9;
}

.label.label-outline-light {
    background-color: transparent;
    color: #3f4254;
    border: 1px solid #f3f6f9;
}

.label.label-outline-light.label-outline-2x {
    border: 2px solid #f3f6f9;
}

.label.label-light-light {
    color: #f3f6f9;
    background-color: #f3f6f9;
}

.label.label-dark {
    color: #ffffff;
    background-color: #181c32;
}

.label.label-outline-dark {
    background-color: transparent;
    color: #181c32;
    border: 1px solid #181c32;
}

.label.label-outline-dark.label-outline-2x {
    border: 2px solid #181c32;
}

.label.label-light-dark {
    color: #181c32;
    background-color: #d1d3e0;
}

.label.label-white {
    color: #3f4254;
    background-color: #ffffff;
}

.label.label-outline-white {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #ffffff;
}

.label.label-outline-white.label-outline-2x {
    border: 2px solid #ffffff;
}

.label.label-light-white {
    color: #ffffff;
    background-color: #ffffff;
}

.text-white {
    color: #ffffff !important;
}

.text-primary {
    color: #47126b !important;
}

a.text-primary:hover,
a.text-primary:focus {
    color: #0073e9 !important;
}

.text-secondary {
    color: #fff !important;
}

a.text-secondary:hover,
a.text-secondary:focus {
    color: #b4bad3 !important;
}

.text-success {
    color: #6411ad !important;
}

a.text-success:hover,
a.text-success:focus {
    color: #12827c !important;
}

.text-info {
    color: #8950fc !important;
}

a.text-info:hover,
a.text-info:focus {
    color: #5605fb !important;
}

.text-warning {
    color: #ffa800 !important;
}

a.text-warning:hover,
a.text-warning:focus {
    color: #b37600 !important;
}

.text-danger {
    color: #f64e60 !important;
}

a.text-danger:hover,
a.text-danger:focus {
    color: #ec0c24 !important;
}

.text-light {
    color: #f3f6f9 !important;
}

a.text-light:hover,
a.text-light:focus {
    color: #c0d0e0 !important;
}

.text-dark {
    color: #181c32 !important;
}

a.text-dark:hover,
a.text-dark:focus {
    color: black !important;
}

.text-white {
    color: #ffffff !important;
}

a.text-white:hover,
a.text-white:focus {
    color: #d9d9d9 !important;
}

.text-body {
    color: #3f4254 !important;
}

.text-muted {
    color: #6411ad !important;
}

.text-black-50 {
    color: rgba(0, 0, 0, 0.5) !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.navi-text a {
    color: #3f4254;
}

.btn.btn-light-primary {
    color: #fff !important;
    background-color: #6411ad;
    border-color: transparent;
}

.bootstrap-select>.dropdown-toggle.btn-light,
.bootstrap-select>.dropdown-toggle.btn-secondary {
    background: #ffffff !important;
    color: #3f4254;
    border-color: var(--color-primary) !important;
    -webkit-box-shadow: none;
    box-shadow: none;
}

.bootstrap-select>.dropdown-toggle.btn-light,
.bootstrap-select>.dropdown-toggle.btn-secondary:focus {
    border-color: var(--color-secondary) !important;
}

.bootstrap-select .dropdown-toggle:focus {
    outline: none !important;
}

/* Timeline */
.timeline {
    height: 300px;
    overflow-y: auto;
    position: relative;
}

.timeline-box {
    position: relative;
}

.timeline-line {
    position: sticky;
    left: 107px;
    top: 0;
    bottom: 0;
    height: auto;
    width: 3px;
    background-color: #ebedf3;
}

.timeline.timeline-6 .timeline-item {
    display: flex;
    align-items: center;
    position: relative;
}

.timeline.timeline-6 .timeline-item .timeline-badge {
    background: white;
    width: 13px;
    height: 13px;
    border-radius: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;

    position: absolute;
    left: -7.5px;
    margin-top: 1px;
    margin-left: 0rem;
    padding: 3px !important;
    border: 6px solid #ffffff !important;
}

.font-size-lg.font-weight-normal.pl-3.text-muted.timeline-content {
    padding-left: 20px !important;
    border-left: 3px solid #ebedf3;
    padding-bottom: 1.7rem;
}

.timeline.timeline-6 .timeline-item .timeline-label {
    max-width: 85px;
    min-width: 85px;
    width: auto !important;
    font-size: 1rem !important;
}

.menu-tutorials {
    background: linear-gradient(90deg, #a44e8d 0%, #3e017a 100%) !important;
}

.menu-nav>.menu-tutorials.menu-item:not(.menu-item-parent):not(.menu-item-open):not(.menu-item-here):not(.menu-item-active):hover>.menu-link {
    background: transparent !important;
}

.menu-tutorials .menu-text,
.aside-menu .menu-nav>.menu-tutorials.menu-item>.menu-link .menu-icon>i {
    color: white !important;
}

.btn.btn-success.focus:not(.btn-text),
.btn.btn-success:focus:not(.btn-text),
.btn.btn-success:hover:not(.btn-text) {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.aside .aside-menu.ps>.ps__rail-y>.ps__thumb-y,
.aside .aside-menu.ps>.ps__rail-y>.ps__thumb-y:hover {
    background: var(--primary);
}

.scroll.ps>.ps__rail-y>.ps__thumb-y:hover {
    width: 5px;
}

.table td.align-center {
    vertical-align: middle;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ============================================ */

/* ===== BASE MOBILE STYLES (< 576px) ===== */
/* Estilos aplicados por padrão - mobile primeiro */

/* Container & Layout */
.container,
.container-fluid {
    padding-left: 10px;
    padding-right: 10px;
}

/* Cards - Prevent Overlap */
.card {
    margin-bottom: 15px;
    overflow: hidden;
}

.card-body {
    padding: 15px;
}

.card-header {
    padding: 12px 15px;
}

/* Row & Columns */
.row {
    margin-left: -8px;
    margin-right: -8px;
}

.row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 12px;
}

.form-control {
    font-size: 14px;
    height: 42px;
    padding: 8px 12px;
}

textarea.form-control {
    height: auto;
    min-height: 80px;
}

/* Buttons */
.btn {
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
    min-height: 44px; /* Touch target mínimo */
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    min-height: 36px;
}

.btn-lg {
    padding: 10px 18px;
    font-size: 14px;
    min-height: 48px;
}

/* Button Groups - Stack on Mobile */
.d-flex.justify-content-between,
.d-flex.justify-content-end {
    flex-wrap: wrap;
    gap: 8px;
}

.d-flex.justify-content-between > .btn,
.d-flex.justify-content-end > .btn {
    flex: 1 1 auto;
    min-width: 100px;
}

/* Tables */
.table-responsive {
    margin: 0 -15px;
    padding: 0 15px;
}

.table {
    font-size: 12px;
}

.table th,
.table td {
    padding: 8px 6px;
    white-space: nowrap;
}

/* Typography */
h1, .h1 { font-size: 1.5rem; }
h2, .h2 { font-size: 1.3rem; }
h3, .h3 { font-size: 1.15rem; }
h4, .h4 { font-size: 1rem; }
h5, .h5 { font-size: 0.95rem; }

/* Modals */
.modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
}

.modal-body {
    padding: 15px;
}

.modal-header,
.modal-footer {
    padding: 12px 15px;
}

/* Aside Menu - Full Width */
.offcanvas-mobile.offcanvas-mobile-on {
    width: 280px;
}

/* Side Panel (Account Page) */
.flex-row-auto.w-250px,
.flex-row-auto.w-xxl-350px {
    width: 100%;
    margin-bottom: 15px;
}

/* Tab Navigation */
.navi.navi-bold .navi-item .navi-link {
    padding: 10px 12px;
}

/* Subheader */
.subheader {
    padding: 10px 0;
}

.subheader .subheader-title {
    font-size: 1.1rem;
}

/* Pagination */
.datatable-pager {
    flex-wrap: wrap;
    gap: 5px;
}

.datatable-pager-link {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
}

/* Dropdowns */
.dropdown-menu {
    max-width: calc(100vw - 20px);
}

/* Select Picker */
.bootstrap-select > .dropdown-toggle {
    height: 42px;
    font-size: 14px;
}

/* Symbol/Avatar */
.symbol.symbol-60,
.symbol.symbol-xxl-100 {
    width: 50px;
    height: 50px;
}

.symbol.symbol-60 .symbol-label,
.symbol.symbol-xxl-100 .symbol-label {
    width: 50px;
    height: 50px;
}

/* Action Buttons in Tables - Touch Target mínimo de 44px */
.btn-icon.btn-sm {
    width: 36px;
    height: 36px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Alerts */
.alert {
    padding: 10px 12px;
    font-size: 13px;
}

/* Badges */
.badge, .label {
    font-size: 10px;
    padding: 4px 8px;
}

/* Input Groups */
.input-group {
    flex-wrap: nowrap;
}

.input-group .form-control {
    min-width: 0;
}

/* Samsung S24 Ultra e dispositivos com alta densidade (376px - 420px) */
/* S24 Ultra viewport: 384px x 824px com DPR 3.75 */
@media screen and (min-width: 376px) and (max-width: 420px) {
    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card-body {
        padding: 14px;
    }

    .card-header {
        padding: 14px 16px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 48px; /* Maior touch target para alta densidade */
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 44px;
    }

    .form-control {
        font-size: 15px;
        height: 46px;
        padding: 10px 14px;
    }

    /* Melhor aproveitamento do viewport alto do S24 Ultra (824px) */
    .card.card-custom.card-custom-size-board {
        min-height: 400px;
    }

    .card.card-custom.card-custom-size-board .card-body {
        max-height: 450px;
    }

    /* Títulos legíveis em alta densidade */
    h1, .h1 { font-size: 1.6rem; }
    h2, .h2 { font-size: 1.4rem; }
    h3, .h3 { font-size: 1.2rem; }

    /* Timeline otimizada para S24 */
    .timeline.timeline-6 .timeline-item .timeline-label {
        max-width: 70px;
        min-width: 70px;
        font-size: 0.9rem;
    }

    /* Symbols/Avatars maiores para alta resolução */
    .symbol.symbol-40 {
        width: 44px !important;
        height: 44px !important;
    }

    .symbol.symbol-40 .symbol-label {
        width: 44px !important;
        height: 44px !important;
    }
}

/* Very Small Mobile (320px - 375px) */
@media screen and (max-width: 375px) {
    .container,
    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }

    .card-body {
        padding: 12px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .form-control {
        font-size: 13px;
        height: 40px;
    }

    /* Hide less important text on very small screens */
    .d-xxs-none {
        display: none;
    }

    /* Stack buttons vertically */
    .d-flex.justify-content-between,
    .d-flex.justify-content-end {
        flex-direction: column;
    }

    .d-flex.justify-content-between > .btn,
    .d-flex.justify-content-end > .btn {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* ===== SM+ (576px+) - Mobile Grande ===== */
@media screen and (min-width: 576px) {
    .container,
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-body {
        padding: 18px;
    }

    .card-header {
        padding: 15px 18px;
    }

    .form-control {
        font-size: 15px;
        height: 44px;
        padding: 10px 14px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 13px;
    }

    .btn-lg {
        padding: 12px 24px;
        font-size: 16px;
    }

    /* Typography */
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
}

/* Medium Mobile (576px - 768px) - Range específico */
@media screen and (min-width: 576px) and (max-width: 767.98px) {
    /* Two columns for form fields */
    .form-group.col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .form-group.col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Side panel still full width */
    .flex-row-auto.w-250px {
        width: 100%;
    }
}

/* ===== MD+ (768px+) - Tablet ===== */
@media screen and (min-width: 768px) {
    .container,
    .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }

    .card {
        margin-bottom: 20px;
    }

    .card-body {
        padding: 20px;
    }

    .card-header {
        padding: 18px 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-control {
        font-size: 16px;
        height: 46px;
        padding: 12px 16px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Button Groups - Horizontal no tablet+ */
    .d-flex.justify-content-between,
    .d-flex.justify-content-end {
        flex-wrap: nowrap;
    }

    .d-flex.justify-content-between > .btn,
    .d-flex.justify-content-end > .btn {
        flex: 0 1 auto;
        min-width: auto;
    }

    /* Tables */
    .table {
        font-size: 14px;
    }

    .table th,
    .table td {
        padding: 10px 8px;
    }

    /* Typography */
    h1, .h1 { font-size: 2rem; }
    h2, .h2 { font-size: 1.75rem; }
    h3, .h3 { font-size: 1.5rem; }

    /* Modals */
    .modal-dialog {
        margin: 30px auto;
        max-width: 500px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-header,
    .modal-footer {
        padding: 18px 20px;
    }

    /* Side panel */
    .flex-row-auto.w-250px {
        width: 220px;
    }

    /* Aside menu - apenas quando minimizado deve ter 70px */
    .aside-minimize .aside {
        width: 70px !important;
    }

    /* Three columns for form fields */
    .form-group.col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ===== LG+ (992px+) - Laptop ===== */
@media screen and (min-width: 992px) {
    .container {
        max-width: 1140px;
    }

    .card-body {
        padding: 24px;
    }

    .card-header {
        padding: 20px 24px;
    }

    .form-control {
        font-size: 16px;
        height: 48px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 16px;
    }

    /* Three columns for form fields */
    .form-group.col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .flex-row-auto.w-250px {
        width: 230px;
    }
}

/* ===== XL+ (1200px+) - Desktop ===== */
@media screen and (min-width: 1200px) {
    .card-body {
        padding: 30px;
    }

    .card-header {
        padding: 24px 30px;
    }
}

/* ============================================
   SPECIFIC COMPONENT FIXES
   ============================================ */

/* ===== COMPONENT-SPECIFIC MOBILE STYLES ===== */

/* Bootstrap Select - Base Mobile */
.bootstrap-select .dropdown-menu {
    max-height: 250px;
}

.bootstrap-select .dropdown-menu li a {
    padding: 8px 12px;
    font-size: 14px;
}

/* Fix for overlapping elements in flex containers - Mobile */
.d-flex {
    flex-wrap: wrap;
}

.d-flex.flex-nowrap {
    flex-wrap: nowrap;
}

/* Prevent card title overlap */
.card-title {
    word-break: break-word;
}

/* Fix action buttons wrapping */
td .btn-group,
td .d-flex {
    flex-wrap: nowrap;
    gap: 2px;
}

/* Vue Table Component */
.vue-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tab content */
.tab-content {
    padding: 0;
}

.tab-pane .card {
    border-radius: 0;
}

/* Profile/Account Page Layout - Mobile */
.d-flex.flex-row {
    flex-direction: column;
}

.flex-row-fluid.ml-lg-8 {
    margin-left: 0;
    margin-top: 15px;
}

#kt_profile_aside {
    width: 100%;
    margin-bottom: 15px;
}

#kt_profile_aside .card {
    margin-bottom: 0;
}

/* Navigation items horizontal scroll on mobile */
.navi.navi-bold {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    padding-bottom: 10px;
}

.navi.navi-bold .navi-item {
    flex-shrink: 0;
}

/* Datatable - Mobile */
.datatable-row {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
    border-bottom: 1px solid #ebedf3;
}

.datatable-cell {
    padding: 5px;
}

/* Horizontal scroll for data tables */
.datatable-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Timeline - Mobile */
.timeline {
    height: auto;
    max-height: 300px;
}

.timeline.timeline-6 .timeline-item .timeline-label {
    max-width: 60px;
    min-width: 60px;
    font-size: 0.85rem;
}

.timeline-content {
    font-size: 13px;
}

/* Input Icons - Mobile */
.input-icon .form-control {
    padding-left: 35px;
}

.input-icon > span {
    left: 10px;
}

.input-icon.input-icon-right .form-control {
    padding-right: 35px;
    padding-left: 12px;
}

.input-icon.input-icon-right > span {
    right: 10px;
    left: auto;
}

/* Switch/Toggle - Mobile */
.switch {
    transform: scale(0.9);
}

/* Ensure proper stacking on mobile */
.col-lg-4,
.col-lg-6,
.col-lg-8,
.col-lg-12,
.col-md-4,
.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Allow two columns for smaller form fields */
.col-6,
.col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

/* ===== MD+ (768px+) - Tablet e acima ===== */
@media screen and (min-width: 768px) {
    /* Bootstrap Select - Tablet+ */
    .bootstrap-select .dropdown-menu {
        max-height: 300px;
    }

    .bootstrap-select .dropdown-menu li a {
        padding: 10px 16px;
        font-size: 15px;
    }

    /* Fix for overlapping elements - Tablet+ */
    .d-flex {
        flex-wrap: nowrap;
    }

    /* Tab content - Tablet+ */
    .tab-content {
        padding: 20px;
    }

    .tab-pane .card {
        border-radius: 8px;
    }

    /* Profile/Account Page Layout - Tablet+ */
    .d-flex.flex-row {
        flex-direction: row;
    }

    .flex-row-fluid.ml-lg-8 {
        margin-left: 2rem;
        margin-top: 0;
    }

    #kt_profile_aside {
        width: 250px;
        margin-bottom: 0;
    }

    /* Navigation items - Tablet+ */
    .navi.navi-bold {
        flex-direction: column;
        overflow-x: visible;
        gap: 0;
        padding-bottom: 0;
    }

    /* Datatable - Tablet+ */
    .datatable-row {
        display: table-row;
        padding: 0;
    }

    .datatable-cell {
        padding: 10px 8px;
    }

    /* Timeline - Tablet+ */
    .timeline {
        height: auto;
        max-height: none;
    }

    .timeline.timeline-6 .timeline-item .timeline-label {
        max-width: 100px;
        min-width: 100px;
        font-size: 0.9rem;
    }

    .timeline-content {
        font-size: 14px;
    }

    /* Input Icons - Tablet+ */
    .input-icon .form-control {
        padding-left: 40px;
    }

    .input-icon > span {
        left: 12px;
    }

    .input-icon.input-icon-right .form-control {
        padding-right: 40px;
        padding-left: 12px;
    }

    .input-icon.input-icon-right > span {
        right: 12px;
    }

    /* Switch/Toggle - Tablet+ */
    .switch {
        transform: scale(1);
    }

    /* Columns - Tablet+ */
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ===== LG+ (992px+) - Laptop e acima ===== */
@media screen and (min-width: 992px) {
    /* Profile/Account Page Layout - Desktop */
    .flex-row-fluid.ml-lg-8 {
        margin-left: 2.5rem;
    }

    #kt_profile_aside {
        width: 280px;
    }

    /* Columns - Desktop */
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .form-control {
        min-height: 44px;
    }

    .dropdown-item {
        padding: 12px 16px !important;
    }

    .navi-link {
        min-height: 48px;
    }
}

/* Print styles - ensure proper layout */
@media print {
    .aside,
    .header,
    .subheader,
    .footer,
    .btn {
        display: none !important;
    }

    .wrapper {
        padding: 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* Landscape orientation fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .modal-dialog {
        margin: 5px auto !important;
    }

    .modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Safe area for notched devices (iPhone X+) */
@supports (padding: max(0px)) {
    .container,
    .container-fluid {
        padding-left: max(15px, env(safe-area-inset-left)) !important;
        padding-right: max(15px, env(safe-area-inset-right)) !important;
    }

    .aside {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .footer {
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}

/* ============================================
   MELHORIAS ADICIONAIS DE RESPONSIVIDADE
   Adicionado em: 04/12/2025
   ============================================ */

/* ===== ESTILOS GLOBAIS PARA IMAGENS ===== */
img {
    max-width: 100%;
    height: auto;
}

/* ===== MELHORIAS PARA FORMULÁRIOS ===== */

/* Labels mais legíveis no mobile */
.form-label,
label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
}

/* Input groups responsivos */
.input-group {
    flex-wrap: nowrap;
}

.input-group .form-control {
    min-width: 0; /* Permite encolher dentro do flex */
}

/* ===== MELHORIAS PARA CARDS ===== */

/* Card headers com texto truncado */
.card-header .card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media screen and (max-width: 576px) {
    .card-header .card-title {
        white-space: normal;
        word-break: break-word;
    }
}

/* Card actions responsivas */
.card-header .card-toolbar {
    flex-wrap: wrap;
    gap: 5px;
}

@media screen and (max-width: 576px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .card-header .card-toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .card-header .card-toolbar .btn {
        flex: 1;
        min-width: 0;
    }
}

/* ===== MELHORIAS PARA BREADCRUMB ===== */
.breadcrumb {
    flex-wrap: wrap;
    font-size: 12px;
}

.breadcrumb-item {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media screen and (max-width: 576px) {
    .breadcrumb-item {
        max-width: 100px;
    }
}

/* ===== MELHORIAS PARA DROPDOWNS ===== */
.dropdown-menu {
    max-width: calc(100vw - 20px);
    max-height: 300px;
    overflow-y: auto;
}

@media screen and (max-width: 576px) {
    .dropdown-menu {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: 10px !important;
        width: calc(100% - 20px) !important;
        max-height: 50vh;
        transform: none !important;
        border-radius: 12px;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    }

    .dropdown-menu.show {
        animation: slideUp 0.2s ease-out;
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ===== MELHORIAS PARA LISTA DE AÇÕES ===== */
.action-buttons,
.btn-group-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
}

.action-buttons .btn,
.btn-group-actions .btn {
    padding: 6px 10px;
}

@media screen and (max-width: 576px) {
    .action-buttons .btn-text,
    .btn-group-actions .btn-text {
        display: none;
    }
}

/* ===== MELHORIAS PARA SUBHEADER ===== */
.subheader {
    flex-wrap: wrap;
    gap: 10px;
}

.subheader-main {
    flex: 1 1 auto;
    min-width: 200px;
}

.subheader-toolbar {
    flex-wrap: wrap;
    gap: 8px;
}

@media screen and (max-width: 768px) {
    .subheader {
        padding: 10px 0;
    }

    .subheader-main,
    .subheader-toolbar {
        width: 100%;
    }

    .subheader-toolbar .btn {
        flex: 1;
    }
}

/* ===== MELHORIAS PARA SCROLLBAR MOBILE ===== */

/* Scrollbar estilizada para containers horizontais */
.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

.scroll-x::-webkit-scrollbar {
    height: 6px;
}

.scroll-x::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-x::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

/* ===== MELHORIAS PARA WIDGETS/STATS ===== */
.widget-stat {
    min-width: 0; /* Permite encolher */
}

.widget-stat .widget-value {
    font-size: clamp(1.25rem, 4vw, 2rem);
    word-break: break-all;
}

.widget-stat .widget-label {
    font-size: clamp(0.75rem, 2.5vw, 0.875rem);
}

/* ===== MELHORIAS PARA AVATAR/SYMBOL ===== */
@media screen and (max-width: 576px) {
    .symbol.symbol-50 {
        width: 40px !important;
        height: 40px !important;
    }

    .symbol.symbol-50 .symbol-label {
        width: 40px !important;
        height: 40px !important;
    }

    .symbol.symbol-60 {
        width: 45px !important;
        height: 45px !important;
    }

    .symbol.symbol-60 .symbol-label {
        width: 45px !important;
        height: 45px !important;
    }
}

/* ===== MELHORIAS PARA ALERTAS ===== */
.alert {
    padding: 12px 15px;
    font-size: 14px;
    border-radius: 8px;
}

.alert .btn-close {
    padding: 12px;
}

@media screen and (max-width: 576px) {
    .alert {
        padding: 10px 12px;
        font-size: 13px;
    }

    .alert-dismissible {
        padding-right: 40px;
    }
}

/* ===== MELHORIAS PARA STEPS/WIZARD ===== */
.wizard-steps,
.nav-pills.nav-wizard {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 5px;
    padding-bottom: 5px;
}

.wizard-step,
.nav-pills.nav-wizard .nav-item {
    flex-shrink: 0;
}

@media screen and (max-width: 576px) {
    .wizard-step .wizard-label,
    .nav-pills.nav-wizard .nav-link span {
        display: none;
    }

    .wizard-step .wizard-number,
    .nav-pills.nav-wizard .nav-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===== MELHORIAS PARA ACCORDION ===== */
.accordion-button {
    padding: 12px 16px;
    font-size: 14px;
}

@media screen and (max-width: 576px) {
    .accordion-button {
        padding: 10px 12px;
        font-size: 13px;
    }

    .accordion-body {
        padding: 12px;
    }
}

/* ===== MELHORIAS PARA TAB NAVIGATION ===== */
.nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: none;
    gap: 2px;
}

.nav-tabs .nav-item {
    flex-shrink: 0;
}

.nav-tabs .nav-link {
    white-space: nowrap;
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
}

@media screen and (max-width: 576px) {
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ===== UTILITÁRIOS RESPONSIVOS ===== */

/* Esconder em telas muito pequenas */
@media screen and (max-width: 375px) {
    .hide-xxs {
        display: none !important;
    }
}

/* Esconder em mobile */
@media screen and (max-width: 576px) {
    .hide-xs {
        display: none !important;
    }
}

/* Mostrar apenas em mobile */
@media screen and (min-width: 577px) {
    .show-xs-only {
        display: none !important;
    }
}

/* Texto truncado responsivo */
.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media screen and (min-width: 768px) {
    .text-truncate-mobile {
        white-space: normal;
        overflow: visible;
    }
}

/* Stack vertical em mobile */
@media screen and (max-width: 576px) {
    .stack-xs {
        flex-direction: column !important;
    }

    .stack-xs > * {
        width: 100% !important;
    }
}

/* Gap reduzido em mobile */
@media screen and (max-width: 576px) {
    .gap-xs-1 {
        gap: 4px !important;
    }

    .gap-xs-2 {
        gap: 8px !important;
    }
}

/* Padding reduzido em mobile */
@media screen and (max-width: 576px) {
    .p-xs-2 {
        padding: 8px !important;
    }

    .p-xs-3 {
        padding: 12px !important;
    }

    .px-xs-2 {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .py-xs-2 {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
}

/* ===== CORREÇÕES ESPECÍFICAS PARA iOS ===== */

/* Previne zoom duplo em iOS ao clicar em botões */
button,
[type="button"],
[type="submit"],
[type="reset"] {
    -webkit-appearance: none;
    touch-action: manipulation;
}

/* Fix para inputs em iOS */
input,
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0; /* Remove border-radius padrão do iOS */
}

/* Restaura border-radius desejado */
.form-control,
.form-select,
.btn {
    border-radius: 6px;
}

/* ===== CORREÇÕES ESPECÍFICAS PARA ANDROID ===== */

/* Melhora tap highlight no Android */
a,
button,
.btn,
[role="button"] {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

/* ===== ACESSIBILIDADE - FOCO VISÍVEL ===== */

/* Outline visível para navegação por teclado */
*:focus-visible {
    outline: 2px solid var(--color-primary, #47126b);
    outline-offset: 2px;
}

/* Remove outline em cliques de mouse */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ===== LOADING/SKELETON RESPONSIVO ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== FIX PARA OVERFLOW EM FLEX CONTAINERS ===== */
.d-flex {
    min-width: 0; /* Permite filhos encolherem */
}

.flex-grow-1 {
    min-width: 0;
}

/* ===== MELHORIAS PARA LISTAGENS ===== */
.list-group-item {
    padding: 12px 16px;
}

@media screen and (max-width: 576px) {
    .list-group-item {
        padding: 10px 12px;
    }
}

/* ===== FIX PARA POSITION STICKY ===== */
.sticky-top {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* ===== MELHORIAS PARA CALENDÁRIO/DATE PICKER ===== */
@media screen and (max-width: 576px) {
    .flatpickr-calendar {
        width: calc(100vw - 20px) !important;
        max-width: 320px;
    }

    .daterangepicker {
        width: calc(100vw - 20px) !important;
    }
}