@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    color: #606060;
}

/* ═══════════════════════════════════════════
   MOBILE LAYOUT FIXES
   No mobile, o layout muda de "h-screen flex overflow-hidden"
   para scroll vertical normal
═══════════════════════════════════════════ */
@media (max-width: 767px) {
    /* Body e container principal rolam normalmente */
    #app-body {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        flex-direction: column !important;
    }

    /* Área de conteúdo principal — permite scroll */
    #app-body > .flex-1.flex.flex-col,
    #app-body > .flex-1.flex.flex-col.h-screen,
    #app-body > div:not(#desktop-sidebar):not(#mobile-sidebar):not(#mobile-overlay) {
        height: auto !important;
        overflow: visible !important;
        flex: 1 1 auto;
    }

    /* Main content — scroll normal */
    #app-body main,
    #app-body main.flex-1 {
        overflow: visible !important;
        height: auto !important;
        padding: 1rem !important;
        padding-bottom: 2rem !important;
        flex: 1 1 auto;
    }

    /* Cabeçalho fixo no mobile */
    #app-body > div:not(#desktop-sidebar):not(#mobile-sidebar):not(#mobile-overlay) > header {
        position: sticky;
        top: 0;
        z-index: 30;
    }

    /* ─── Tabela responsiva no mobile ───────────────────────────── */
    .mobile-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    /* Esconde colunas não essenciais em tabelas no mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Container da tabela no kanban — scroll horizontal */
    .table-container {
        max-height: 60vh !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Tabela kanban — scroll horizontal suave */
    #leads-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Contador de pacientes em mobile */
    .patient-counter {
        font-size: 0.75rem !important;
    }

    /* Filtros em mobile — coluna única */
    .date-filter-select {
        width: 100% !important;
        min-width: unset !important;
    }

    /* Mini dashboard cards */
    .recovery-banner {
        font-size: 0.72rem !important;
    }

    /* ─── Modais bottom-sheet no mobile ──────────────────────── */
    .modal-bottom-sheet > .modal-content {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 1rem 1rem 0 0 !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
    }

    /* ─── Página Pacientes Loja ──────────────────────────────── */
    #pacientes-loja-filters {
        flex-direction: column !important;
    }
    #pacientes-loja-filters > * {
        width: 100% !important;
    }

    /* ─── Calendário mobile ──────────────────────────────────── */
    .fc-toolbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: center !important;
    }
    .fc-toolbar-chunk {
        display: flex !important;
        gap: 4px !important;
    }
    .fc .fc-toolbar.fc-header-toolbar {
        margin-bottom: 0.75em !important;
    }

    /* ─── Header do sistema no mobile ───────────────────────── */
    header h1 {
        font-size: 0.95rem !important;
    }

    /* ─── Botões de cabeçalho de página ─────────────────────── */
    .page-header-actions {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
}

/* Custom Scrollbar for Kanban */
.kanban-board {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
}

.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Kanban column and cards */
.kanban-column {
    min-width: 300px;
    max-width: 300px;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-right: 1rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 12rem);
}

.kanban-cards {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 50px;
}

.kanban-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.sortable-ghost {
    opacity: 0.4;
}

/* Hide scrollbar for columns */
.kanban-cards::-webkit-scrollbar {
    width: 4px;
}

.kanban-cards::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-cards::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

/* FullCalendar Overrides */
.fc-event {
    cursor: pointer;
    border: none;
}

.fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: 600;
    color: #00375e;
}

.fc-button-primary {
    background-color: #0090a3 !important;
    border-color: #0090a3 !important;
}

.fc-button-primary:hover {
    background-color: #007c8d !important;
}