:root {
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 70px;
    --primary-color: #0f172a;
    /* Darker blue/slate */
    --secondary-color: #1e293b;
    --accent-color: #3b82f6;
    /* Bright blue for active/hover */
    --text-color: #334155;
    --text-light: #f8fafc;
    /* Almost white */
    --header-height: 60px;
}

body {
    background-color: #f1f5f9;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Login Page */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #0ca0c5);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    max-width: 400px;
    text-align: center;
    color: #fff;
}

.login-card img {
    width: 80px;
    margin-bottom: 20px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 1050;
    /* Higher than content */
    padding: 0;
    background-color: var(--secondary-color);
    transition: all 0.3s;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    /* background-color: rgba(235, 227, 227, 0.1); REMOVED per user request to remove 'line' */
    margin-bottom: 0px;
    cursor: pointer;
    /* Allow clicking to toggle */
}

.sidebar-logo {
    width: 35px;
    height: 35px;
    object-fit: contain;
    transition: all 0.3s;
    flex-shrink: 0;
}

.sidebar-brand {
    margin-left: 12px;
    color: var(--text-light);
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-brand h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.sidebar-brand small {
    font-size: 0.75rem;
    color: #94a3b8;
    /* Lighter slate for subtitle */
}

/* Navigation Links */
.nav-pills .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: #94a3b8;
    border-radius: 0;
    transition: all 0.2s;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-pills .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.nav-pills .nav-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    /* Transparent blue */
    color: var(--accent-color);
    border-left-color: var(--accent-color);
}

.sidebar-icon {
    font-size: 1.1rem;
    min-width: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-text {
    margin-left: 12px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

/* Content */
.content {
    margin-left: var(--sidebar-width);
    padding: 20px;
    transition: all 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .content {
        margin-left: 0 !important;
        width: 100%;
    }
}

/* Header */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: rgba(226, 232, 240, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -20px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: -0.5px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
}

.header .bi,
.header .btn-link,
.header #user-name-display {
    color: var(--text-color) !important;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Global Card Styles */
.card {
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
}

/* Force smaller fonts inside cards */
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.card-title {
    font-size: 0.95rem !important;
    margin-bottom: 0.25rem !important;
}

.card p,
.card-text,
.card li,
.card td,
.card th

/* .card span, */
/* .card div, */
/* .card-body */
    {
    font-size: 0.82rem !important;
}

.card .text-muted {
    font-size: 0.85rem !important;
}

/* Override Bootstrap display classes inside cards to be smaller */
.card .display-1,
.card .display-2,
.card .display-3,
.card .display-4,
.card .display-5,
.card .display-6 {
    font-size: 2.2rem !important;
    font-weight: 600 !important;
}

.card-header {
    font-size: 1rem !important;
    font-weight: 600;
    padding: 0.5rem 1rem !important;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed #admin-submenu,
.sidebar.collapsed #paginas-submenu,
.sidebar.collapsed #sync-submenu {
    display: none !important;
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-icon {
    margin: 0;
}

.content.collapsed {
    margin-left: var(--sidebar-width-collapsed);
}

/* Overlay for mobile only */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(0);
        /* Open by default logic, but we toggle class */
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        /* Hidden when collapsed */
    }

    .content {
        margin-left: 0 !important;
        width: 100%;
    }

    .content.collapsed {
        margin-left: 0 !important;
        width: 100%;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .sidebar .sidebar-brand {
        display: flex;
        opacity: 1;
        width: auto;
    }

    .sidebar .sidebar-text {
        display: block;
        opacity: 1;
    }

    .sidebar .nav-link {
        justify-content: flex-start;
        padding: 12px 20px;
    }

    .sidebar .sidebar-icon {
        margin-right: 0;
        border-left-color: var(--accent-color);
    }

    .sidebar-icon {
        font-size: 1.25rem;
        min-width: 30px;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .sidebar-text {
        margin-left: 12px;
        white-space: nowrap;
        opacity: 1;
        transition: opacity 0.2s;
    }

    /* Content */
    .content {
        margin-left: var(--sidebar-width);
        padding: 20px;
        transition: all 0.3s;
        min-height: 100vh;
    }

    /* Header */
    .header {
        height: var(--header-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 30px;
        background-color: #fff;
    }

    /* Sidebar Collapsed State */
    .sidebar.collapsed {
        width: var(--sidebar-width-collapsed);
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: center;
        padding: 0;
    }

    .sidebar.collapsed .sidebar-brand,
    .sidebar.collapsed .sidebar-text,
    .sidebar.collapsed #admin-submenu,
    .sidebar.collapsed #paginas-submenu,
    .sidebar.collapsed #sync-submenu {
        display: none !important;
        opacity: 0;
        width: 0;
        height: 0;
        overflow: hidden;
    }

    .sidebar.collapsed .nav-link {
        justify-content: center;
        padding: 12px 0;
    }

    .sidebar.collapsed .sidebar-icon {
        margin: 0;
    }

    .content.collapsed {
        margin-left: var(--sidebar-width-collapsed);
    }

    /* Overlay for mobile only */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(0);
        /* Open by default logic, but we toggle class */
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        /* Hidden when collapsed */
    }

    .content {
        margin-left: 0 !important;
        width: 100%;
    }

    .content.collapsed {
        margin-left: 0 !important;
        width: 100%;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .sidebar .sidebar-brand {
        display: flex;
        opacity: 1;
        width: auto;
    }

    .sidebar .sidebar-text {
        display: block;
        opacity: 1;
    }

    .sidebar .nav-link {
        justify-content: flex-start;
        padding: 12px 20px;
    }

    .sidebar .sidebar-icon {
        margin-right: 0;
        /* Reset if needed */
    }
}

/* Desktop Overlay - ensure hidden */
@media (min-width: 769px) {
    .sidebar-overlay.show {
        display: none;
    }
}

/* Pulsing Green Animation */
@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

.pulsing-green {
    animation: pulse-green 2s infinite;
}

/* IA Chat Table Styles */
#ia-chat-output table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 15px 0 !important;
    font-size: 0.9rem !important;
    border: 1px solid #dee2e6 !important;
}

#ia-chat-output th,
#ia-chat-output td {
    padding: 10px !important;
    border: 1px solid #dee2e6 !important;
}

#ia-chat-output th {
    background-color: #f8f9fa !important;
    font-weight: 600 !important;
}

#ia-chat-output tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

#ia-chat-output tr:hover {
    background-color: #f1f5f9 !important;
}

/* Print Optimization (General) */
@media print {
    @page {
        size: A4;
        margin: 5mm;
    }

    body {
        background-color: white;
        zoom: 0.7;
    }

    /* Hide Navigation and Buttons */
    .sidebar,
    .sidebar-overlay,
    .btn,
    .btn-close,
    .navbar,
    #dash-btn-filters {
        display: none !important;
    }

    /* Reset Content Layout */
    .content,
    .content.collapsed {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .container-fluid {
        padding: 0 !important;
    }

    /* Ensure Cards print well */
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    /* Table optimizations */
    table {
        width: 100% !important;
    }

    /* Headers black */
    h1,
    h2,
    h3,
    h4,
    h5 {
        color: black !important;
    }
}

/* KPI Card Styles */
.card-body-kpi {
    display: flex;
    opacity: 1;
}

.sidebar .sidebar-brand {
    display: flex;
    opacity: 1;
    width: auto;
}

.sidebar .sidebar-text {
    display: block;
    opacity: 1;
}

.sidebar .nav-link {
    justify-content: flex-start;
    padding: 12px 20px;
}

.sidebar .sidebar-icon {
    margin-right: 0;
    /* Reset if needed */
}

/* Desktop Overlay - ensure hidden */
@media (min-width: 769px) {
    .sidebar-overlay.show {
        display: none;
    }
}

/* Pulsing Green Animation */
@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

.pulsing-green {
    animation: pulse-green 2s infinite;
}

/* IA Chat Table Styles */
#ia-chat-output table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 15px 0 !important;
    font-size: 0.9rem !important;
    border: 1px solid #dee2e6 !important;
}

#ia-chat-output th,
#ia-chat-output td {
    padding: 10px !important;
    border: 1px solid #dee2e6 !important;
}

#ia-chat-output th {
    background-color: #f8f9fa !important;
    font-weight: 600 !important;
}

#ia-chat-output tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

#ia-chat-output tr:hover {
    background-color: #f1f5f9 !important;
}

/* Print Optimization */
@media print {
    @page {
        size: A4;
        margin: 5mm;
    }

    body {
        background-color: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        zoom: 0.65;
    }

    /* Hide Sidebar, Buttons, and unnecessary elements */
    .sidebar,
    .sidebar-overlay,
    #dash-btn-filters,
    #dash-btn-pdf,
    .btn-close,
    .offcanvas,
    .offcanvas-backdrop {
        display: none !important;
    }

    /* Reset Content Margins */
    .content,
    .content.collapsed {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: auto !important;
    }

    /* Adjust Layout for Print */
    .container-fluid {
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* Force Grid System for Print */
    .row {
        display: flex !important;
        flex-wrap: wrap !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    /* Default to full width */
    .col-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        padding-right: 5px !important;
        padding-left: 5px !important;
    }

    /* Cards: 4 per row on PC (md-3), force 2 per row (50%) for print readability */
    .col-md-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
    }

    /* Charts: 2 per row on PC (lg-6/md-6), force 2 per row (50%) for print */
    .col-lg-6,
    .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
    }

    /* Specific override for full width charts if any (like Ranking por Familia) */
    /* If it has only col-12 and no md/lg specific class, it stays 100% from .col-12 rule above */
    /* Compact Cards */
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #eee !important;
        box-shadow: none !important;
        margin-bottom: 10px !important;
    }

    .card-header {
        padding: 5px 10px !important;
        background-color: #f8f9fa !important;
    }

    .card-body {
        padding: 5px !important;
    }

    /* Adjust Graph Heights for Print */
    .js-plotly-plot {
        height: auto !important;
        max-height: 300px !important;
    }

    /* Ensure text is readable */
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: #000 !important;
    }
}

/* KPI Card Styles */
.card-body-kpi {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

/* Mobile Button Sizing */
@media (max-width: 768px) {

    #btn-dash-total,
    #btn-dash-dist,
    #btn-dash-loja,
    #dash-btn-valor,
    #dash-btn-unit,
    #dash-btn-pdf,
    #btn-vendas-total,
    #btn-vendas-dist,
    #btn-vendas-loja,
    #vendas-btn-valor,
    #vendas-btn-unit,
    #vendas-btn-view-cols,
    #vendas-btn-period,
    #btn-open-filters,
    #btn-export-tab,
    #btn-add-cli,
    #btn-edit-cli,
    #btn-delete-cli,
    #ia-btn-new-chat,
    #btn-global-search {
        padding: 8px 16px !important;
        font-size: 0.9rem !important;
    }

    #dash-filter-ano .Select-control,
    #dash-filter-mes .Select-control,
    #dash-filter-grupo .Select-control,
    #vendas-filter-ano .Select-control,
    #vendas-filter-mes .Select-control,
    #tab-filter-vendedor .Select-control,
    #tab-filter-uf .Select-control,
    #tab-filter-cidade .Select-control {
        height: 30px !important;
        min-height: 30px !important;
        font-size: 0.75rem !important;
    }

    #dash-filter-ano .Select-placeholder,
    #dash-filter-mes .Select-placeholder,
    #dash-filter-grupo .Select-placeholder,
    #dash-filter-ano .Select-value-label,
    #dash-filter-mes .Select-value-label,
    #dash-filter-grupo .Select-value-label,
    #vendas-filter-ano .Select-placeholder,
    #vendas-filter-mes .Select-placeholder,
    #vendas-filter-ano .Select-value-label,
    #vendas-filter-mes .Select-value-label,
    #tab-filter-vendedor .Select-placeholder,
    #tab-filter-vendedor .Select-value-label,
    #tab-filter-uf .Select-placeholder,
    #tab-filter-uf .Select-value-label,
    #tab-filter-cidade .Select-placeholder,
    #tab-filter-cidade .Select-value-label {
        line-height: 30px !important;
    }

    #ia-input-question,
    #global-search-input,
    #tab-search-input {
        height: 38px !important;
        font-size: 0.9rem !important;
    }

    .mkt-date-label {
        font-weight: normal !important;
        margin-bottom: 2px !important;
        display: block;
    }
}

/* Desktop Styles for Labels */
@media (min-width: 769px) {
    .mkt-date-label {
        font-weight: bold;
    }
}

.kpi-content-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

/* Novo wrapper que envolve o nÃÂºmero grande e os badges */
.kpi-value-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Centraliza verticalmente o nÃÂºmero e os badges de comparaÃÂ§ÃÂ£o */
    flex-grow: 1;
}

/* Fix Full Height Tabs */
.tabs-full-height .tab-content,
.tabs-full-height .tab-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Garante que ocupe o espaÃÂ§o para centralizaÃÂ§ÃÂ£o */


/* Additional Print Styles */
@media print {

    /* Force KPI Cards to be in one line (5 cards -> 20%) */
    .kpi-row>.col {
        flex: 0 0 20% !important;
        max-width: 20% !important;
        width: 20% !important;
    }
}

/* Company Toggle Buttons Standardization */
.btn-company-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    width: 100% !important;
    white-space: nowrap !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.btn-company-toggle i {
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .btn-company-toggle {
        font-size: 0.85rem;
        padding: 0.375rem 0.25rem !important;
    }
}

/* Mobile Improvements for Marketing Page */
@media (max-width: 768px) {

    /* Fullscreen Modals */
    .modal-dialog {
        width: 100vw !important;
        margin: 0 !important;
        max-width: none !important;
        height: 100% !important;
    }

    .modal-content {
        height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
    }

    .modal-body {
        overflow-y: auto !important;
    }

    /* Table Padding & Font Sizing */
    .table td,
    .table th {
        padding: 8px 4px !important;
        font-size: 11px !important;
        white-space: nowrap;
    }

    /* Force table containers to handle overflow nicely */
    .card-body {
        overflow-x: hidden;
        /* Prevent card itself from stretching page */
        padding: 10px !important;
    }

    /* Target the dcc.Loading div or explicit scroll containers */
    div[style*="overflowX: auto"],
    div[style*="overflow-x: auto"] {
        max-width: 100vw !important;
        /* Force constraint to viewport width */
        width: 100% !important;
        display: block;
        -webkit-overflow-scrolling: touch;
    }

    /* Improve button touch targets */
    .btn {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Filters Container Spacing */
    #marketing-lead-date,
    #marketing-op-date {
        width: 100% !important;
    }

    /* Ensure datepicker inputs are touch-friendly */
    .DateInput_input {
        height: 44px !important;
        line-height: normal !important;
    }

    /* Adjust DatePickerRange container */
    .DateRangePickerInput {
        width: 100% !important;
        display: flex !important;
    }

    .DateInput {
        width: 48% !important;
        flex: 1 !important;
    }
}

/* Mobile Table Font Size Reduction */
@media (max-width: 768px) {

    .table td,
    .table th {
        font-size: 11px !important;
        padding: 4px 2px !important;
    }

    .content,
    .card-body {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .modal-dialog {
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* ForÃ§ar exibiÃ§Ã£o de colunas ocultas no mobile para permitir scroll horizontal */
@media (max-width: 768px) {

    /* Sobrescreve a ocultaÃ§Ã£o do Bootstrap dentro das abas de detalhamento */
    #content-det-leads .d-none,
    #content-det-ops .d-none,
    #content-det-rd .d-none,
    #content-det-suri .d-none,
    #content-det-vendas .d-none {
        display: table-cell !important;
    }

    /* Garante que o container permita o scroll suave */
    div[id^="content-det-"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        display: block;
    }
}

.pulsing-green {
    background-color: #28a745;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* --- APP-LIKE MOBILE OPTIMIZATIONS (GENERATED) --- */
/* 1. Fluid Typography for KPIs & Cards - RESTRICTED TO MOBILE */
@media (max-width: 768px) {

    .display-4,
    .display-5,
    .display-6,
    h1,
    h2,
    h3,
    h4 {
        font-size: clamp(1.2rem, 4vw, 2.5rem) !important;
    }
}

.kpi-value,
.card-title,
.h4,
h4 {
    font-size: clamp(1rem, 3.5vw, 1.5rem);
}

/* 2. Mobile Layout (< 768px) */
@media (max-width: 768px) {

    /* Compact Cards */
    .card {
        min-height: auto !important;
        margin-bottom: 10px !important;
    }

    .card-body {
        padding: 10px !important;
    }

    /* 3. Optimized Tables */
    .table,
    .dash-spreadsheet,
    .dash-table-container {
        font-size: 11px !important;
        width: 100% !important;
    }

    .table th,
    .table td,
    .dash-header,
    .dash-cell {
        padding: 4px 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 120px !important;
        /* Truncate long text */
        height: auto !important;
    }

    /* Fix Dash specific inline style overrides */
    .dash-spreadsheet-container .dash-spreadsheet-inner th,
    .dash-spreadsheet-container .dash-spreadsheet-inner td {
        padding: 4px 2px !important;
        font-size: 11px !important;
        min-width: unset !important;
        /* Allow shrinking */
    }

    /* 4. Scrollable Containers */
    /* Ensure tables scroll instead of breaking layout */
    .table-responsive,
    .dash-table-container,
    div[id^='content-'],
    .js-plotly-plot {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Container do Logo no Sidebar */
.sidebar-logo-area {
    height: 60px;
    /* Ajuste conforme a altura do seu Navbar principal */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Evita que imagem grande quebre o layout */
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* Separador sutil opcional */
    margin-bottom: 1rem;
    transition: all 0.3s;
}

/* Ajuste da imagem para caber sempre */
.sidebar-logo-area img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

/* Remove fundo e bordas do Accordion para fundir com o Sidebar */
#sidebar .accordion-item,
#sidebar .accordion-button {
    background-color: transparent !important;
    border: none !important;
    color: inherit !important;
    /* Herda a cor do texto do sidebar (branco/cinza) */
    box-shadow: none !important;
    padding-left: 1rem;
    /* Alinhamento */
}

/* Ãcone da seta do Accordion (opcional: ajustar cor se sumir) */
#sidebar .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
    /* Torna a seta branca se o fundo for escuro */
}

/* Quando o item do submenu estÃ¡ ativo/hover */
#sidebar .accordion-button:not(.collapsed) {
    background-color: rgba(255, 255, 255, 0.1) !important;
    /* Destaque sutil */
    color: #fff !important;
}

/* Garante que Ã­cones (.bi) dentro do submenu fiquem visÃ­veis */
#sidebar .accordion-body .nav-link i,
#sidebar .accordion-button i {
    margin-right: 10px;
    color: inherit;
    /* Segue a cor do texto */
}

/* Item de submenu ativo */
#sidebar .accordion-body .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* --- DatePicker Adjustments for Forecast Page --- */
/* Wrapper */
.custom-date-picker {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    /* Forces height to match 48px of other inputs */
    height: 48px !important;
    border: 1px solid #ced4da;
    /* Bootstrap standard border */
    border-radius: 4px;
    /* overflow: hidden; REMOVED to allow popup */
}

/* Ensure the popup shows above other things */
.custom-date-picker .DateRangePicker_picker {
    z-index: 9999 !important;
}

/* React-Dates container overrides */
.custom-date-picker .DateRangePicker {
    width: 100% !important;
    display: block !important;
}

.custom-date-picker .DateRangePickerInput {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background-color: transparent !important;
    border: none !important;
    height: 40px !important;
    /* Slightly less than wrapper to fit border */
    padding: 0 4px !important;
}

/* The actual date text inputs */
.custom-date-picker .DateInput {
    width: 42% !important;
    /* 42% + 42% + arrow space */
    background: transparent !important;
    flex-grow: 1;
}

.custom-date-picker .DateInput_input {
    width: 100% !important;
    font-size: 0.85rem !important;
    /* Smaller font to fit date */
    line-height: 40px !important;
    padding: 0 !important;
    text-align: center !important;
    border-bottom: none !important;
    background: transparent !important;
    color: #495057 !important;
    font-weight: 500;
}

/* The Arrow */
.custom-date-picker .DateRangePickerInput_arrow {
    padding: 0 4px !important;
    flex-shrink: 0;
}

/* Focus states */
.custom-date-picker .DateInput_input__focused {
    border-bottom: 2px solid #007eff !important;
    /* Visual focus indicator */
}

/* Small screens adjustments */
@media (max-width: 576px) {}

/* Responsive Action Buttons */
.responsive-action-btn {
    width: 100%;
    flex: 1;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0 4px;
    min-width: 0;
}

.responsive-wrapper {
    display: flex;
    /* Ensure it behaves as flex container if needed, or flex item */
    flex: 1;
    min-width: 0;
}

@media (min-width: 992px) {
    .responsive-action-btn {
        width: 160px !important;
        flex: 0 0 auto;
        /* Do not grow/shrink */
        font-size: 1rem;
        padding: 0.375rem 0.75rem;
    }

    .responsive-wrapper {
        flex: 0 0 auto;
        /* Do not grow */
        width: auto;
    }
}

/* --- KANBAN BOARD STYLES --- */
.kanban-board-container {
    overflow-x: auto;
    padding-bottom: 20px;
    height: calc(100vh - 140px);
    /* Adjust based on header */
}

.kanban-column {
    min-width: 280px;
    max-width: 320px;
    margin-right: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kanban-column-header {
    background-color: transparent !important;
    padding: 10px 5px !important;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-color);
    border-radius: 4px 4px 0 0;
    /* Colored top border is applied inline or via specific classes */
}

.kanban-column-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
}

.kanban-column-count {
    background-color: #e2e8f0;
    color: #475569;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kanban-col-body {
    background-color: #f1f5f9;
    /* Match body bg for seamless look or slightly darker? Image uses flat columns */
    /* Let's make columns transparent so cards float */
    background-color: transparent !important;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
    /* For scrollbar space */
}

/* Custom Scrollbar for columns */
.kanban-col-body::-webkit-scrollbar {
    width: 6px;
}

.kanban-col-body::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-col-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

/* KANBAN CARD REDESIGN */
.kanban-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    margin-bottom: 8px;
    /* Reduced from 12px */
    padding: 8px;
    /* Reduced from 12px */
    position: relative;
    cursor: pointer;
}

.kanban-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    border-color: #cbd5e1 !important;
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.kanban-card-id {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    background-color: #e0f2fe;
    /* Light blue pill */
    color: #0284c7;
    padding: 2px 6px;
    border-radius: 4px;
}

.kanban-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.4;
}

.kanban-card-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kanban-tag {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    margin-right: 4px;
    margin-bottom: 4px;
}

.kanban-tag.tag-primary {
    background-color: #eff6ff;
    color: #3b82f6;
    border-color: #dbeafe;
}

.kanban-tag.tag-success {
    background-color: #f0fdf4;
    color: #22c55e;
    border-color: #dcfce7;
}

.kanban-tag.tag-warning {
    background-color: #fffbeb;
    color: #f59e0b;
    border-color: #fef3c7;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.7rem;
    color: #94a3b8;
}

.kanban-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: bold;
}

.kanban-actions {
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.2s;
}

.kanban-card:hover .kanban-actions {
    opacity: 1;
}

/* STAGE SPECIFIC BORDERS */
.kanban-card.border-left-slate {
    border-left: 4px solid #64748b !important;
}

.kanban-card.border-left-purple {
    border-left: 4px solid #8b5cf6 !important;
}

.kanban-card.border-left-amber {
    border-left: 4px solid #f59e0b !important;
}

.kanban-card.border-left-blue {
    border-left: 4px solid #3b82f6 !important;
}

.kanban-card.border-left-emerald {
    border-left: 4px solid #10b981 !important;
}

.kanban-card.border-left-indigo {
    border-left: 4px solid #6366f1 !important;
}

/* Pulsing Danger Animation */
@keyframes pulse-danger {
    0% {
        transform: scale(0.98);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        transform: scale(0.98);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.pulsing-danger {
    animation: pulse-danger 2s infinite;
}

/* Pulsing Warning Animation */
@keyframes pulse-warning {
    0% {
        transform: scale(0.98);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }

    100% {
        transform: scale(0.98);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.pulsing-warning {
    animation: pulse-warning 2s infinite;
}

/* --- GLOBAL KANBAN OPTIMIZATION (PC & MOBILE) --- */
.kanban-board-container {
    width: 100%;
    max-width: 100vw;
    /* Hard limit */
    overflow-x: hidden;
    /* Prevent horizontal scroll on all devices (PC fix) */
}

/* Fix flexbox overflow issues to ensure columns fit */
.kanban-column {
    min-width: 0;
    word-wrap: break-word;
}

/* Ensure cards don't overflow columns */
.kanban-card {
    max-width: 100%;
}

/* --- MOBILE OPTIMIZATION FOR KANBAN (SEPAR) --- */
@media (max-width: 768px) {

    /* ForÃ§a o container do Kanban a ocupar tudo */
    .kanban-board-container {
        padding-left: 5px !important;
        padding-right: 5px !important;
        overflow-x: hidden;
        /* Evita scroll horizontal indesejado */
    }

    /* ForÃ§a as colunas a serem largura total e empilhadas */
    .kanban-column {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 1.5rem;
        /* EspaÃ§o entre as colunas verticais */
        padding: 0 !important;
        /* Remove padding extra da coluna */
    }

    /* OTIMIZAÃÃO CRÃTICA DO CARD */
    .kanban-card {
        width: 100% !important;
        /* Ocupa 100% da coluna */
        box-sizing: border-box !important;
        /* Garante que padding nÃ£o estoure a largura */
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0.75rem !important;
        display: block !important;
        /* Garante comportamento de bloco */
    }

    /* Ajuste fino no conteÃºdo interno do card para mobile */
    .kanban-card .card-body {
        padding: 10px !important;
        /* Padding levemente menor para ganhar espaÃ§o */
    }

    /* Se houver botÃµes de aÃ§Ã£o, garantir que nÃ£o quebrem */
    .kanban-actions {
        position: relative !important;
        opacity: 1 !important;
        /* Sempre visÃ­vel no mobile, pois nÃ£o tem "hover" */
        top: 0 !important;
        right: 0 !important;
        margin-top: 10px;
        text-align: right;
    }
}

/* --- CORREÃÃO DA BARRA SUPERIOR (TOP BAR) --- */
/* .top-bar-container merged below */
/* ForÃ§a o DatePicker a ter a mesma altura dos Inputs Bootstrap (48px) */
.DateInput,
.DateInput_input,
.DateRangePickerInput {
    height: 48px !important;
    line-height: 48px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex;
    align-items: center;
}

/* --- CORREÃÃO DOS CARDS KANBAN --- */
.kanban-card .card-body {
    padding: 0.75rem !important;
    /* Reduzido para diminuir bordas internas conforme solicitado (0.75rem = ~12px) */
}

/* --- CHECKBOX LIMPO (SEM MOLDURA) --- */
/* --- CHECKBOX LIMPO (ESTILO SUTIL) --- */
.kanban-card .form-check-input {
    border: 1px solid #cbd5e1 !important;
    /* Borda sutil visÃ­vel */
    background-color: #fff !important;
    /* Fundo branco */
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    margin-right: 10px;
    border-radius: 4px;
}

.kanban-card .form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.kanban-card .form-check-input:focus {
    box-shadow: none !important;
    /* Remove o anel de foco azul */
    outline: none !important;
}

/* --- TOP BAR RESPONSIVA (MOBILE) --- */
/* No Desktop: Linha Ãºnica. No Mobile: Coluna empilhada */
.top-bar-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center !important;
    align-content: center !important;
    gap: 10px;
    padding: 10px 15px;
    min-height: 60px;
    background-color: #ffffff;
    /* REMOÃÃO TOTAL DE LINHAS E SOMBRAS */
    box-shadow: none !important;
    border-bottom: none !important;
    /* Remove a linha cinza */
    border: none !important;
    margin-bottom: 15px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .top-bar-container {
        flex-direction: column;
        align-items: stretch;
        /* BotÃµes esticados no mobile */
        height: auto !important;
    }

    .top-bar-container .btn,
    .top-bar-container .form-control,
    .top-bar-container .DateInput_input,
    .top-bar-container .DateRangePickerInput {
        width: 100% !important;
        margin-bottom: 5px;
    }

    /* Esconde o divisor vertical no mobile */
    .top-bar-divider {
        display: none !important;
    }
}

/* On mobile, let it be full width */
@media (max-width: 768px) {}

/* QUILL EDITOR ENHANCEMENTS */
/* Restrict maximum width of images in the editor preview and output */
.ql-editor img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Ensure tables in Quill have borders (if pasted) */
.ql-editor table {
    width: 100%;
    border-collapse: collapse;
}

.ql-editor th,
.ql-editor td {
    border: 1px solid #ccc;
    padding: 5px;
}

/* --- RESPONSIVE SEPAR KANBAN (OCORRENCIAS STYLE) --- */
/* Wrapper Container (Flex Row Desktop, Column Mobile) */
.separ-board-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    height: 100%;
    padding: 0 10px;
}

/* Individual Column Container */
.separ-column {
    min-width: 320px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #fff;
    border-radius: 0.25rem;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    padding: 1rem;
    color: #212529;
    /* Transition for smooth resize */
    transition: all 0.3s ease;
}

/* Internal Column Scroll Area */
.separ-column-body {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 100px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.separ-column-body::-webkit-scrollbar {
    width: 6px;
}

.separ-column-body::-webkit-scrollbar-track {
    background: transparent;
}

.separ-column-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 768px) {

    /* Stack Columns Vertically */
    .separ-board-wrapper {
        flex-direction: column;
        height: auto !important;
        /* Allow growing */
        padding-bottom: 50px;
        /* Space for bottom scroll */
    }

    /* Columns become full width and flexible height */
    .separ-column {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 300px;
        /* Min height for dropping */
        max-height: 600px;
        /* Cap height to allow scrolling next col */
        margin-bottom: 20px;
    }

    /* Adjust Card fonts for Mobile */
    .kanban-card-title {
        font-size: 0.9rem !important;
    }
}

/* --- KANBAN OCORRENCIAS RESPONSIVO --- */
/* Container Principal do Board */
.ocorrencias-board-wrapper {
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    /* Desktop: Sem scroll horizontal */
    padding: 0 10px;
}

/* Coluna Individual */
.ocorrencias-column {
    flex: 1;
    /* Desktop: Divide espaÃ§o igualmente */
    min-width: 0;
    /* Permite encolher se necessÃ¡rio */
    display: flex;
    flex-direction: column;
    background-color: #fff;
    /* Opcional: ou manter transparente */
    border-radius: 8px;
    height: 100%;
    max-height: 100%;
    transition: all 0.3s;
}

/* Corpo da Coluna (Ãrea dos Cards) */
.ocorrencias-col-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    /* Custom Scrollbar visual */
    scrollbar-width: thin;
}

/* --- MOBILE BREAKPOINT --- */
@media (max-width: 768px) {
    .ocorrencias-board-wrapper {
        flex-direction: column;
        /* Empilha verticalmente */
        overflow-y: auto;
        /* Scroll na pÃ¡gina toda */
        overflow-x: hidden;
        height: auto !important;
        /* Deixa crescer */
        padding-bottom: 50px;
    }

    .ocorrencias-column {
        width: 100%;
        flex: none;
        /* Remove proporÃ§Ã£o flex */
        height: auto !important;
        /* Altura automÃ¡tica baseada no conteÃºdo */
        max-height: none !important;
        margin-bottom: 15px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    /* Ajuste para o corpo colapsÃ¡vel no mobile */
    .ocorrencias-col-body {
        min-height: 0;
        /* O conteÃºdo serÃ¡ controlado pelo dbc.Collapse */
    }
}

@media (max-width: 768px) {}

/* --- DATEPICKER FIXES (CONSOLIDATED) --- */
#date-filter-separ.custom-date-picker,
#date-filter-ocorrencias.custom-date-picker {
    width: 260px !important;
    min-width: 260px !important;
    flex: none !important;
}

@media (max-width: 768px) {

    #date-filter-separ.custom-date-picker,
    #date-filter-ocorrencias.custom-date-picker {
        width: 100% !important;
        min-width: 100% !important;
    }
}

/* --- KANBAN RESPONSIVO (CLEAN) --- */
.ocorrencias-board-wrapper {
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    padding: 0 10px;
}

.ocorrencias-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    height: 100%;
    transition: all 0.3s;
}

.ocorrencias-col-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
}

/* MOBILE */
@media (max-width: 768px) {
    .ocorrencias-board-wrapper {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        height: auto !important;
        padding-bottom: 80px;
    }

    .ocorrencias-column {
        width: 100%;
        flex: none;
        height: auto !important;
        margin-bottom: 15px;
        border: 1px solid #e2e8f0;
    }

    .ocorrencias-col-body {
        min-height: 100px;
        /* Garante área de drop */
    }
}

/* Increase height/size of the Calendar Popup (Forecast) - Adjusted */
.custom-date-picker .CalendarDay {
    height: 38px !important;
    width: 38px !important;
    line-height: 38px !important;
    font-size: 0.9rem !important;
}

.custom-date-picker .CalendarMonth_caption {
    padding-top: 10px !important;
    padding-bottom: 45px !important;
    font-size: 1.1rem !important;
}

.custom-date-picker .DayPicker_weekHeader {
    top: 55px !important;
    padding-bottom: 5px !important;
}

.custom-date-picker .DayPicker_transitionContainer {
    height: 320px !important;
}

.custom-date-picker .DayPicker_focusRegion {
    height: auto !important;
}

/* Sidebar Mobile Overlay */
@media (max-width: 1199.98px) {
    .sidebar-mobile-overlay {
        position: fixed !important;
        top: 60px !important;
        left: 0;
        width: 85% !important;
        height: calc(100vh - 60px) !important;
        z-index: 2050 !important;
        background-color: white !important;
        border-right: 1px solid #dee2e6 !important;
        display: block !important;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) !important;
        overflow-y: auto !important;
    }
}

/* IA Page Layout Modes */
#chat-layout-wrapper {
    transition: all 0.3s ease-in-out;
}

#chat-layout-wrapper.ia-layout-centered {
    justify-content: center;
    align-items: center;
    background-color: #ffffff !important;
}

#ia-greeting {
    transition: opacity 0.3s ease;
}

#chat-layout-wrapper.ia-layout-centered #ia-greeting {
    display: block;
    opacity: 1;
    margin-bottom: 2rem;
}

#chat-layout-wrapper:not(.ia-layout-centered) #ia-greeting {
    display: none;
    opacity: 0;
}

/* Messages Area */
#chat-layout-wrapper.ia-layout-centered #ia-chat-messages {
    display: none;
}

#chat-layout-wrapper:not(.ia-layout-centered) #ia-chat-messages {
    display: block;
    flex-grow: 1;
    overflow-y: auto;
}

/* Input Wrapper */
#ia-input-wrapper {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#chat-layout-wrapper.ia-layout-centered #ia-input-wrapper {
    width: 100%;
    max-width: 800px;
    background: transparent;
    border: none !important;
    padding: 2rem !important;
}

#chat-layout-wrapper:not(.ia-layout-centered) #ia-input-wrapper {
    width: 100%;
    max-width: 100%;
    background-color: #fff;
    border-top: 1px solid #dee2e6 !important;
    padding: 1rem !important;
}

/* Input Group/Controls styling adjustments */
#chat-layout-wrapper.ia-layout-centered textarea {
    min-height: 56px !important;
    border-radius: 28px !important;
    padding-left: 24px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

#chat-layout-wrapper.ia-layout-centered .btn {
    width: 50px;
    height: 50px;
    border-radius: 50% !important;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide mic button in centered mode if desired, or keep it. Keeping it. */


/* Fix for IA Layout Centering - Keep Header at Top */
#chat-layout-wrapper.ia-layout-centered {
    justify-content: flex-start !important;
    align-items: stretch !important;
}

#chat-layout-wrapper.ia-layout-centered #chat-inner-container {
    justify-content: center !important;
    align-items: center !important;
}

#chat-layout-wrapper:not(.ia-layout-centered) #chat-inner-container {
    justify-content: flex-start !important;
    align-items: stretch !important;
}

/* Modern DatePicker Styles */
.DateRangePickerInput {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 38px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.DateRangePickerInput:hover {
    border-color: #b3b3b3;
}

.DateRangePickerInput__withBorder {
    border: none;
}

.DateInput {
    width: 90px;
    background: transparent;
}

.DateInput_input {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #495057;
    background-color: transparent;
    border: none;
    padding: 6px 10px;
    text-align: center;
    font-family: inherit;
    font-weight: 500;
}

.DateInput_input__focused {
    border-bottom: 2px solid var(--accent-color);
}

.DateRangePickerInput_arrow {
    color: #6c757d;
}

.CalendarDay__selected,
.CalendarDay__selected:active,
.CalendarDay__selected:hover {
    background: var(--accent-color);
    border: 1px solid var(--accent-color);
    color: #fff;
}

.CalendarDay__default:hover {
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
}


/* Kanban Column Titles */
.kanban-col-title {
    /* Dispositivos Maiores (PC) */
    font-size: 0.9rem !important;
}

@media (max-width: 768px) {
    .kanban-col-title {
        font-size: 1.2rem !important;
    }
}
/* Mobile Only Display Toggle */
.mobile-only-toggle {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only-toggle {
        display: inline-block !important;
    }
}
