/* ===================================
   Global Styles & Variables
   =================================== */
:root {
    /* Primary Colors - FisioFácil Brand */
    --primary-color: #234939;
    --primary-hover: #1a3629;
    --primary-light: #e8f0ed;

    /* Secondary Colors - FisioFácil Brand */
    --secondary-color: #748b3c;
    --secondary-hover: #5d6f30;
    --secondary-light: #f0f3e8;

    /* Accent Colors */
    --accent-blue: #3B82F6;
    --accent-success: #10B981;
    --accent-warning: #F59E0B;
    --accent-yellow: #FBBF24;
    --accent-danger: #EF4444;

    /* Neutral Colors */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-white: #FFFFFF;
    --text-light: #94A3B8;
    --border-color: #E5E7EB;
    --border-secondary-color: #2a9d90;

    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --dark: #1E293B;

    /* Backgrounds */
    --bg-success-light: #f4faf9;

    /* Accents */
    --accent-orange: #FF9800;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Spacing */
    --spacing-xs: 6px;
    --spacing-sm: 10px;
    --spacing-md: 14px;
    --spacing-lg: 20px;
    --spacing-xl: 28px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Scale Sizes */
    --scale-size: 1;
    --scale-translateY: 0px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
}

/* ===================================
   Typography
   =================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

/* ===================================
   Top Navigation Bar
   =================================== */
.navbar {
    padding: 0.5rem 0;
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    z-index: 1000;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-img-mobile {
    height: 35px;
    width: auto;
}

/* Navigation Items */
.navbar-nav {
    gap: 4px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px !important;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--primary-light);
    font-weight: 600;
}

.nav-link i {
    font-size: 15px;
}

/* User Profile Dropdown */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-light);
    margin-right: 8px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 6px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.dropdown-toggle {
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    opacity: 0.8;
}

.dropdown-toggle::after {
    margin-left: 8px;
}

.dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    padding: 12px;
    min-width: 220px;
    margin-top: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1050 !important;
}

/* Dropdown dentro de tabelas - garantir que não seja cortado */
.table .dropdown {
    position: static;
}

.table .dropdown-menu {
    position: absolute !important;
    z-index: 1050 !important;
    will-change: transform;
}

.dropdown-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.dropdown-item i {
    width: 20px;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: var(--border-color);
}

/* Mobile Menu Button */
#mobileMenuBtn {
    color: var(--text-primary);
    font-size: 24px;
    padding: 8px;
}

/* ===================================
   Main Content Area
   =================================== */
.main-content {
    padding-top: 70px;
    padding-bottom: 100px;
    min-height: 100vh;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.welcome-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ===================================
   Statistics Cards
   =================================== */
.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.stat-card-success .stat-icon {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
    color: white;
}

.stat-card-warning .stat-icon {
    background: linear-gradient(135deg, var(--accent-warning), #D97706);
    color: white;
}

.stat-card-info .stat-icon {
    background: linear-gradient(135deg, var(--accent-blue), #2563EB);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background-color: var(--secondary-light);
    color: var(--secondary-color);
}

.badge-info {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* ===================================
   Content Cards
   =================================== */
.content-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: visible;
    transition: all 0.3s ease;
}

/* Garantir que o card-body não corte dropdowns */
.content-card .card-body {
    overflow: visible;
    position: relative;
}

.content-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header-custom {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, var(--bg-secondary), var(--primary-light));
}

.card-title-custom {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.card-subtitle-custom {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 0;
    margin-top: 4px;
}

.card-body {
    padding: var(--spacing-md);
}

/* ===================================
   Card Custom - sinze 2026-01-30
   =================================== */

.content-card,
.patient-header-card {
    animation: fadeIn 0.4s ease-out;
}

.content-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow: visible;
    transition: var(--transition);
    background: white;
}

.content-card .card-header {
    background: var(--light-bg);
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

/* ===================================
   Patients Table - Clickable Rows
   =================================== */
#patientsTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#patientsTable tbody tr:hover {
    background-color: var(--primary-light) !important;
}

#patientsTable tbody tr td:last-child {
    cursor: default;
}

#patientsTable tbody tr td:last-child a {
    cursor: pointer;
}

/* ===================================
   Appointments Section
   =================================== */
.appointment-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.appointment-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.appointment-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    min-width: 80px;
}

.time-hour {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.time-meridiem {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}

.appointment-details {
    flex: 1;
}

.appointment-patient {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.appointment-type {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.appointment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: 6px;
}

.meta-item {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

.meta-item i {
    color: var(--text-secondary);
    margin-right: 4px;
}

.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-status-confirmed {
    background-color: var(--secondary-light);
    color: var(--secondary-color);
}

.badge-status-pending {
    background-color: #FEF3C7;
    color: #D97706;
}

.badge-status-cancelled {
    background-color: #FEE2E2;
    color: #DC2626;
}

.appointment-actions {
    display: flex;
    gap: 8px;
}

.appointment-actions .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

/* ===================================
   Quick Actions Grid
   =================================== */
.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
    cursor: pointer;
}

.quick-action-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quick-action-btn i {
    font-size: 22px;
}

.quick-action-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
}

.quick-action-success {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
}

.quick-action-info {
    background: linear-gradient(135deg, var(--accent-blue), #2563EB);
}

.quick-action-warning {
    background: linear-gradient(135deg, var(--accent-warning), #D97706);
}

/* ===================================
   Team Status Section
   =================================== */
.team-member {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-sm);
}

.team-member:hover {
    background-color: var(--bg-primary);
}

.team-member img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.team-info {
    flex: 1;
}

.team-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.team-specialty {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
}

.status-available {
    background-color: var(--success);
}

.status-busy {
    background-color: var(--warning);
}

.status-offline {
    background-color: var(--text-light);
}

/* ===================================
   DataTables Styling
   =================================== */
.table {
    margin-bottom: 0;
    position: relative;
}

/* Garantir que a tabela e wrappers não cortem dropdowns */
.table-wrapper,
.dataTables_wrapper,
.dataTables_scrollBody {
    overflow: visible !important;
}

/* Linha superior do DataTables: registros à esquerda, pesquisa à direita, mesma altura */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Página Pacientes: campo de busca alinhado à extrema direita */
#patientsTableContainer .dataTables_wrapper .row:first-child {
    display: flex;
    align-items: center;
}

#patientsTableContainer .dataTables_wrapper .row:first-child>div {
    flex: 1 1 auto;
}

#patientsTableContainer .dataTables_wrapper .dataTables_filter {
    justify-content: flex-end;
    text-align: right;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    height: 38px;
    margin: 0;
}

/* Tabela de Pacientes: visual mais amigável */
#patientsTableContainer .table {
    border-collapse: separate;
    border-spacing: 0;
}

#patientsTableContainer .table thead th {
    background: #f9fafb;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

#patientsTableContainer .table tbody td {
    vertical-align: middle;
    border-color: #f1f5f9;
}

#patientsTableContainer .table tbody tr:hover {
    background-color: #f3f4ff;
}

/* Ajustar scroll apenas no corpo da tabela quando necessário */
.dataTables_scrollBody {
    overflow-y: auto !important;
    overflow-x: visible !important;
}

.table thead th {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    padding: 11px 14px;
    vertical-align: middle;
    font-size: 13px;
    color: var(--text-primary);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--bg-primary);
}

/* ===================================
   Buttons
   =================================== */
.btn {
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 9px 18px;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bs-btn-hover-bg);
    border-color: var(--text-white);
    color: var(--text-white);
}

.btn-outline-danger {
    border: 1px solid var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-outline-dark {
    border: 1px solid var(--dark);
    color: var(--dark);
    background: transparent;
}

.btn-outline-info:hover {
    background: var(--info);
    color: white;
}

.btn-outline-info {
    border: 1px solid var(--info);
    color: var(--info);
    background: transparent;
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: white;
}

.btn-outline-warning {
    border: 1px solid var(--warning);
    color: var(--warning);
    background: transparent;
}

.btn-outline-success:hover {
    background: #198754;
    color: white;
}

.btn-outline-success {
    border: 1px solid #157347;
    color: #157347;
    background: transparent;
}

.btn-light {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-light:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===================================
   Form Controls
   =================================== */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 8px;
}

/* Floating Labels */
.form-floating>.form-control {
    height: calc(3.5rem + 2px);
}

.form-floating>label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 2px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: #cbcbcb;
    font-weight: 500;
}

/* ===================================
   Badges
   =================================== */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.bg-success {
    background-color: var(--secondary-color) !important;
}

.bg-warning {
    background-color: var(--accent-orange) !important;
}

.bg-danger {
    background-color: var(--danger) !important;
}

.bg-info {
    background-color: var(--info) !important;
}

.bg-teste-gratuito {
    background-color: var(--accent-yellow) !important;
}

.bg-white-alt {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

/* ===================================
   Mobile Bottom Navigation
   =================================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    z-index: 999;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    cursor: pointer;
}

.mobile-nav-item i {
    font-size: 18px;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-nav-center {
    position: relative;
    top: -16px;
}

.mobile-nav-center i {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Mobile Offcanvas Menu
   =================================== */
.offcanvas {
    border: none;
}

.offcanvas-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.offcanvas-body {
    padding: var(--spacing-lg);
}

.mobile-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg) 0;
}

.mobile-user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-light);
    margin-bottom: var(--spacing-md);
}

.mobile-user-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mobile-user-role {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-list li {
    margin-bottom: 8px;
}

.mobile-menu-list a {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 14px var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-menu-list a:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.mobile-menu-list a i {
    font-size: 18px;
    width: 24px;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 991.98px) {
    .navbar-nav {
        display: none;
    }

    .navbar {
        display: none !important;
    }

    .main-content {
        padding-top: 20px;
        padding-bottom: 80px;
    }

    .welcome-title {
        font-size: 1.375rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-md);
    }

    .appointment-item {
        flex-direction: column;
    }

    .appointment-actions {
        width: 100%;
        justify-content: center;
    }

    .quick-action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .stat-number {
        font-size: 1.5rem;
    }

    .card-header-custom {
        padding: var(--spacing-md);
    }

    .card-body {
        padding: var(--spacing-md);
    }

    .appointment-meta {
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 575.98px) {
    .welcome-section {
        text-align: center;
    }

    .welcome-section .btn {
        width: 100%;
        margin-top: var(--spacing-md);
    }
}

/* ===================================
   Utilities
   =================================== */
.cursor-pointer {
    cursor: pointer !important;
}

.fw-semibold {
    font-weight: 600;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.text-white {
    color: var(--text-white) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card,
.stat-card {
    animation: fadeIn 0.6s ease-out;
}

/* ===================================
   Date Range Picker Custom Styling
   =================================== */
.daterangepicker {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.daterangepicker .calendar-table {
    border-radius: var(--radius-sm);
}

.daterangepicker td.active,
.daterangepicker td.active:hover {
    background-color: var(--primary-color);
}

/* Datas com avaliação/evolução no prontuário (filtro por data) */
.daterangepicker td.has-avaliacao:not(.off):not(.disabled),
.daterangepicker td.has-evolucao:not(.off):not(.disabled) {
    position: relative;
}

.daterangepicker td.has-avaliacao:not(.off):not(.disabled)::after,
.daterangepicker td.has-evolucao:not(.off):not(.disabled)::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* ===================================
   FullCalendar Customization
   =================================== */
.fc {
    background: white;
    border-radius: 14px;
    padding: 20px;
}

.fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: var(--text-primary);
}

.fc-button {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    font-size: 13px !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
}

.fc-button:hover {
    background: var(--primary-hover) !important;
}

.fc-button-active {
    background: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
}

.fc-daygrid-day-number,
.fc-col-header-cell-cushion {
    color: var(--text-primary);
    font-weight: 500;
}

.fc-event {
    border-radius: 6px;
    border: none;
    padding: 2px 4px;
}

.fc-event-title {
    font-weight: 500;
    font-size: 12px;
}

.fc-daygrid-day-top {
    justify-content: center;
}

.fc-day-past.fc-daygrid-day .fc-daygrid-day-frame {
    border: 1px solid #f7f7f7;
}

.fc-day-past.fc-daygrid-day .fc-daygrid-day-frame .fc-daygrid-day-top .fc-daygrid-day-number {
    color: #b9b9b9;
}



/* ===================================
   Plan Card Styles
   =================================== */
.plan-card {
    background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.plan-header {
    background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.plan-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #64748B, #94A3B8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.15);
}

.plan-icon i {
    font-size: 24px;
    color: white;
}

/* Avatar Card Styles */
.avatar-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.avatar-wrapper img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.avatar-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.avatar-badge i {
    font-size: 14px;
    color: var(--primary-color);
}

.user-info-section {
    margin-bottom: 0px;
}

.user-name-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-role-display {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.account-type-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-color);
    margin-bottom: 20px;
}

.avatar-actions {
    display: block;
    /*display: flex;
    flex-direction: column;
    gap: 8px;*/
}

.avatar-actions .btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

.avatar-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.plan-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.plan-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.plan-details {
    padding: 20px;
}

.plan-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.plan-item:hover {
    background: white;
    transform: translateX(4px);
}

.plan-item-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plan-item-icon i {
    font-size: 16px;
    color: var(--text-secondary);
}

.plan-item-content {
    flex: 1;
}

.plan-item-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.plan-item-value {
    font-size: 15px;
    color: var(--text-primary);
}

.plan-progress {
    margin-top: 8px;
    width: 100%;
}

/* Accordion Minha Conta: espaçamento entre itens (como na modal de nova avaliação) */
#accordionMinhaConta.accordion .accordion-item {
    margin-bottom: 1rem;
}

#accordionMinhaConta.accordion .accordion-item:last-child {
    margin-bottom: 0;
}

.plan-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-days {
    background: var(--secondary-light);
    color: var(--secondary-color);
}

.plan-footer {
    padding: 20px;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.plan-footer .btn {
    background: var(--primary-color);
    border: none;
    padding: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(35, 73, 57, 0.15);
    transition: all 0.3s ease;
}

.plan-footer .btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 73, 57, 0.2);
}

.plan-link {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.plan-link:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.plan-link i {
    font-size: 11px;
}


/* ===================================
   Payment History Modal Styles
   =================================== */
.payment-history-modal {
    border-radius: 16px;
}

.payment-history-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0 !important;
}

.payment-history-header {
    margin-bottom: 20px;
}

.payment-stat-card {
    background: var(--primary-light);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-stat-card i {
    font-size: 24px;
    color: var(--primary-color);
}

.payment-stat-card .stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.payment-stat-card .stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-top: 4px;
}

.payment-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.payment-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.payment-item.payment-paid {
    border-left: 4px solid var(--success);
}

.payment-item.payment-pending {
    border-left: 4px solid var(--warning);
    background: #FFFBF0;
}

.payment-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 10px;
}

.date-day {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.date-month {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.payment-details {
    flex: 1;
}

.payment-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.payment-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.payment-info i {
    font-size: 11px;
}

.payment-amount {
    text-align: right;
    min-width: 120px;
}

.amount-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.payment-amount .badge {
    font-size: 11px;
    padding: 4px 10px;
}

.payment-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.payment-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Scrollbar customization for modal */
.payment-history-container::-webkit-scrollbar {
    width: 6px;
}

.payment-history-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

.payment-history-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.payment-history-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .payment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .payment-amount {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .payment-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .payment-footer {
        flex-direction: column;
    }

    .payment-footer button {
        width: 100%;
    }
}



/* ============================================
   FULL CALENDAR - REMOVER BORDER DAS CELULAS
============================================ */
.fc-theme-standard .fc-scrollgrid,
.fc-daygrid table tbody,
tr.fc-scrollgrid-section.fc-scrollgrid-section-body,
.fc-daygrid table tbody tr,
.fc-daygrid table tbody tr td {
    border: 0px !important;
}

.fc-col-header thead th {
    border: 0px !important;
}

.fc-daygrid-body table tbody tr {
    border: 0px !important;
}

.fc-daygrid-body table tbody tr td {
    border: 0px !important;
}

.fc-daygrid-body table tbody tr td .fc-daygrid-day-frame {
    border-radius: 8px;
    border: 1px solid var(--fc-border-color);
    margin: 1px !important;
    min-height: 130px;
    cursor: pointer;
}

.fc-daygrid-body table tbody tr td .fc-daygrid-day-frame:hover {
    border: 1px solid var(--primary-color);
}

.fc-day-past.fc-day-other,
.fc-day-future.fc-day-other {
    opacity: 0 !important;
    height: 0px !important;
    visibility: hidden !important;
}

.fc-day-today .fc-daygrid-day-frame {
    background-color: var(--bg-success-light) !important;
    border: 1px solid var(--border-secondary-color) !important;
}

.fc .fc-daygrid-day-top {
    flex-direction: column;
}

.fc .fc-daygrid-day-number {
    padding: 4px;
    position: relative;
    z-index: 4;
    text-decoration: none;
}



/* ============================================
   ESCALA DE DOR (EVA) - RÉGUA
============================================ */
.pain-scale-wrapper {
    width: 100%;
    margin-bottom: 25px;
}

.pain-scale-ruler {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.5rem;
}

.pain-scale-item {
    flex: 1;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.pain-scale-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.pain-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: #6b7280;
    transition: all 0.3s ease;
}

/* Estados ativos por valor */
.pain-scale-item[data-value="0"].active {
    background: #1CC633;
    border-color: #1CC633;
    box-shadow: 0 6px 12px -2px rgba(28, 198, 51, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.pain-scale-item[data-value="1"].active,
.pain-scale-item[data-value="2"].active {
    background: #7FC810;
    border-color: #7FC810;
    box-shadow: 0 6px 12px -2px rgba(127, 200, 16, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.pain-scale-item[data-value="3"].active,
.pain-scale-item[data-value="4"].active {
    background: #FFCC00;
    border-color: #FFCC00;
    box-shadow: 0 6px 12px -2px rgba(255, 204, 0, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.pain-scale-item[data-value="5"].active,
.pain-scale-item[data-value="6"].active {
    background: #FF9800;
    border-color: #FF9800;
    box-shadow: 0 6px 12px -2px rgba(255, 152, 0, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.pain-scale-item[data-value="7"].active,
.pain-scale-item[data-value="8"].active {
    background: #FC6718;
    border-color: #FC6718;
    box-shadow: 0 6px 12px -2px rgba(252, 103, 24, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.pain-scale-item[data-value="9"].active,
.pain-scale-item[data-value="10"].active {
    background: #F42724;
    border-color: #F42724;
    box-shadow: 0 6px 12px -2px rgba(244, 39, 36, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.pain-scale-item.active .pain-number {
    color: white;
    font-size: 1.5rem;
}

/* Tooltip - apenas no hover */
.pain-scale-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    z-index: 10;
}

.pain-scale-item::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    margin-bottom: 2px;
    z-index: 10;
}

.pain-scale-item:hover::before,
.pain-scale-item:hover::after {
    opacity: 1;
}

/* Labels de intensidade */
.pain-scale-labels {
    position: relative;
    width: 100%;
    height: 0px;
    padding: 0px 0px 20px 0px;
}

.pain-intensity-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
}

.pain-intensity-label:nth-child(1) {
    color: #1CC633;
    transform: translateX(0);
    left: 0 !important;
}

.pain-intensity-label:nth-child(2) {
    color: #7FC810;
}

.pain-intensity-label:nth-child(3) {
    color: #FFCC00;
}

.pain-intensity-label:nth-child(4) {
    color: #FF9800;
}

.pain-intensity-label:nth-child(5) {
    color: #FC6718;
}

.pain-intensity-label:nth-child(6) {
    color: #F42724;
    transform: translateX(-100%);
    left: 100% !important;
}

/* Estilos para escala de mobilidade */
#mobilidadeScale .pain-scale-item[data-value="0"].active {
    background: #1CC633;
    border-color: #1CC633;
    box-shadow: 0 6px 12px -2px rgba(28, 198, 51, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#mobilidadeScale .pain-scale-item[data-value="1"].active {
    background: #FFCC00;
    border-color: #FFCC00;
    box-shadow: 0 6px 12px -2px rgba(255, 204, 0, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#mobilidadeScale .pain-scale-item[data-value="2"].active {
    background: #FF9800;
    border-color: #FF9800;
    box-shadow: 0 6px 12px -2px rgba(255, 152, 0, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#mobilidadeScale .pain-scale-item[data-value="3"].active {
    background: #F42724;
    border-color: #F42724;
    box-shadow: 0 6px 12px -2px rgba(244, 39, 36, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#mobilidadeScale .pain-intensity-label:nth-child(1) {
    color: #1CC633;
    transform: translateX(0);
    left: 0 !important;
}

#mobilidadeScale .pain-intensity-label:nth-child(2) {
    color: #FFCC00;
}

#mobilidadeScale .pain-intensity-label:nth-child(3) {
    color: #FF9800;
}

#mobilidadeScale .pain-intensity-label:nth-child(4) {
    color: #F42724;
    transform: translateX(-100%);
    left: 100% !important;
}

/* Estilos para escala de força (1=vermelho pior, 5=verde melhor) - aplica a #forcaScale, #evolucaoForcaScale, #aiForcaScale e .escala-forca */
#forcaScale .pain-scale-item[data-value="1"].active,
#evolucaoForcaScale .pain-scale-item[data-value="1"].active,
#aiForcaScale .pain-scale-item[data-value="1"].active,
#medicaoForcaScale .pain-scale-item[data-value="1"].active,
.escala-forca .pain-scale-item[data-value="1"].active {
    background: #F42724;
    border-color: #F42724;
    box-shadow: 0 6px 12px -2px rgba(244, 39, 36, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#forcaScale .pain-scale-item[data-value="2"].active,
#evolucaoForcaScale .pain-scale-item[data-value="2"].active,
#aiForcaScale .pain-scale-item[data-value="2"].active,
#medicaoForcaScale .pain-scale-item[data-value="2"].active,
.escala-forca .pain-scale-item[data-value="2"].active {
    background: #FF9800;
    border-color: #FF9800;
    box-shadow: 0 6px 12px -2px rgba(255, 152, 0, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#forcaScale .pain-scale-item[data-value="3"].active,
#evolucaoForcaScale .pain-scale-item[data-value="3"].active,
#aiForcaScale .pain-scale-item[data-value="3"].active,
#medicaoForcaScale .pain-scale-item[data-value="3"].active,
.escala-forca .pain-scale-item[data-value="3"].active {
    background: #FFCC00;
    border-color: #FFCC00;
    box-shadow: 0 6px 12px -2px rgba(255, 204, 0, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#forcaScale .pain-scale-item[data-value="4"].active,
#evolucaoForcaScale .pain-scale-item[data-value="4"].active,
#aiForcaScale .pain-scale-item[data-value="4"].active,
#medicaoForcaScale .pain-scale-item[data-value="4"].active,
.escala-forca .pain-scale-item[data-value="4"].active {
    background: #7FC810;
    border-color: #7FC810;
    box-shadow: 0 6px 12px -2px rgba(127, 200, 16, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#forcaScale .pain-scale-item[data-value="5"].active,
#evolucaoForcaScale .pain-scale-item[data-value="5"].active,
#aiForcaScale .pain-scale-item[data-value="5"].active,
#medicaoForcaScale .pain-scale-item[data-value="5"].active,
.escala-forca .pain-scale-item[data-value="5"].active {
    background: #1CC633;
    border-color: #1CC633;
    box-shadow: 0 6px 12px -2px rgba(28, 198, 51, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#forcaScale .pain-intensity-label:nth-child(1),
#evolucaoForcaScale .pain-intensity-label:nth-child(1),
#aiForcaScale .pain-intensity-label:nth-child(1),
#medicaoForcaScale .pain-intensity-label:nth-child(1),
.escala-forca .pain-intensity-label:nth-child(1) {
    color: #F42724;
    transform: translateX(0);
    left: 0 !important;
}

#forcaScale .pain-intensity-label:nth-child(2),
#evolucaoForcaScale .pain-intensity-label:nth-child(2),
#aiForcaScale .pain-intensity-label:nth-child(2),
#medicaoForcaScale .pain-intensity-label:nth-child(2),
.escala-forca .pain-intensity-label:nth-child(2) {
    color: #FF9800;
}

#forcaScale .pain-intensity-label:nth-child(3),
#evolucaoForcaScale .pain-intensity-label:nth-child(3),
#aiForcaScale .pain-intensity-label:nth-child(3),
#medicaoForcaScale .pain-intensity-label:nth-child(3),
.escala-forca .pain-intensity-label:nth-child(3) {
    color: #FFCC00;
}

#forcaScale .pain-intensity-label:nth-child(4),
#evolucaoForcaScale .pain-intensity-label:nth-child(4),
#aiForcaScale .pain-intensity-label:nth-child(4),
#medicaoForcaScale .pain-intensity-label:nth-child(4),
.escala-forca .pain-intensity-label:nth-child(4) {
    color: #7FC810;
}

#forcaScale .pain-intensity-label:nth-child(5),
#evolucaoForcaScale .pain-intensity-label:nth-child(5),
#aiForcaScale .pain-intensity-label:nth-child(5),
#medicaoForcaScale .pain-intensity-label:nth-child(5),
.escala-forca .pain-intensity-label:nth-child(5) {
    color: #1CC633;
    transform: translateX(-100%);
    left: 100% !important;
}

/* Estilos para escala de Borg */
#medicaoBorgScale .pain-scale-item[data-value="0"].active {
    background: #E5E7EB;
    border-color: #E5E7EB;
    box-shadow: 0 6px 12px -2px rgba(229, 231, 235, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#medicaoBorgScale .pain-scale-item[data-value="1"].active,
#medicaoBorgScale .pain-scale-item[data-value="2"].active {
    background: #FEF3C7;
    border-color: #FEF3C7;
    box-shadow: 0 6px 12px -2px rgba(254, 243, 199, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#medicaoBorgScale .pain-scale-item[data-value="3"].active,
#medicaoBorgScale .pain-scale-item[data-value="4"].active,
#medicaoBorgScale .pain-scale-item[data-value="5"].active {
    background: #FDE047;
    border-color: #FDE047;
    box-shadow: 0 6px 12px -2px rgba(253, 224, 71, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#medicaoBorgScale .pain-scale-item[data-value="6"].active,
#medicaoBorgScale .pain-scale-item[data-value="7"].active {
    background: #FBBF24;
    border-color: #FBBF24;
    box-shadow: 0 6px 12px -2px rgba(251, 191, 36, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#medicaoBorgScale .pain-scale-item[data-value="8"].active,
#medicaoBorgScale .pain-scale-item[data-value="9"].active {
    background: #F97316;
    border-color: #F97316;
    box-shadow: 0 6px 12px -2px rgba(249, 115, 22, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

#medicaoBorgScale .pain-scale-item[data-value="10"].active {
    background: #F42724;
    border-color: #F42724;
    box-shadow: 0 6px 12px -2px rgba(244, 39, 36, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}


/* ============================================
   ESCALA MRC (MEDICAL RESEARCH COUNCIL)
============================================ */
.mrc-scale-wrapper {
    width: 100%;
    flex: 1;
    min-width: 0;
}

.mrc-scale-ruler {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 0;
}

.mrc-scale-item {
    flex: 1;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mrc-scale-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.mrc-number {
    font-size: 1rem;
    font-weight: 700;
    color: #6b7280;
    transition: all 0.3s ease;
}

/* Cores invertidas: 0=vermelho, 5=verde */
.mrc-scale-item[data-value="0"].active {
    background: #F42724;
    border-color: #F42724;
    box-shadow: 0 6px 12px -2px rgba(244, 39, 36, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.mrc-scale-item[data-value="1"].active {
    background: #FC6718;
    border-color: #FC6718;
    box-shadow: 0 6px 12px -2px rgba(252, 103, 24, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.mrc-scale-item[data-value="2"].active {
    background: #FF9800;
    border-color: #FF9800;
    box-shadow: 0 6px 12px -2px rgba(255, 152, 0, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.mrc-scale-item[data-value="3"].active {
    background: #FFCC00;
    border-color: #FFCC00;
    box-shadow: 0 6px 12px -2px rgba(255, 204, 0, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.mrc-scale-item[data-value="4"].active {
    background: #7FC810;
    border-color: #7FC810;
    box-shadow: 0 6px 12px -2px rgba(127, 200, 16, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.mrc-scale-item[data-value="5"].active {
    background: #1CC633;
    border-color: #1CC633;
    box-shadow: 0 6px 12px -2px rgba(28, 198, 51, 0.5);
    transform: scale(var(--scale-size)) translateY(var(--scale-translateY));
}

.mrc-scale-item.active .mrc-number {
    color: white;
    font-size: 1.25rem;
}

.mrc-scale-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    z-index: 10;
    max-width: 200px;
    text-align: center;
}

.mrc-scale-item::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    margin-bottom: 2px;
    z-index: 10;
}

.mrc-scale-item:hover::before,
.mrc-scale-item:hover::after {
    opacity: 1;
}

/* Labels de intensidade MRC */
.mrc-scale-labels {
    position: relative;
    width: 100%;
    height: 15px;
    margin-top: 0.5rem;
}

.mrc-intensity-label {
    position: absolute;
    /*transform  : translateX(-50%);*/
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    /*padding    : 0.25rem 0.5rem;*/
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    /*box-shadow : 0 2px 4px rgba(0, 0, 0, 0.1);*/
    max-width: 16%;
    overflow-x: hidden;
}

.mrc-intensity-label[data-value="0"] {
    /*color: white;
    background: #F42724;*/
    color: #F42724;
    background: transparent;
}

.mrc-intensity-label[data-value="1"] {
    /*color: white;
    background: #FC6718;*/
    color: #FC6718;
    background: transparent;
}

.mrc-intensity-label[data-value="2"] {
    /*color: #333;
    background: #FF9800;*/
    color: #FF9800;
    background: transparent;
}

.mrc-intensity-label[data-value="3"] {
    /*color: #333;
    background: #FFCC00;*/
    color: #FFCC00;
    background: transparent;
}

.mrc-intensity-label[data-value="4"] {
    /*color: white;
    background: #7FC810;*/
    color: #7FC810;
    background: transparent;
}

.mrc-intensity-label[data-value="5"] {
    /*color: white;
    background: #1CC633;*/
    color: #1CC633;
    background: transparent;
}

.mrc-groups-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.mrc-group-item {
    display: block;
    grid-template-columns: max-content 1fr;
    gap: 1.5rem;
    align-items: start;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.mrc-group-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    min-width: 160px;
    /*max-width: 180px;*/
    flex-shrink: 0;
    margin-bottom: 15px;
}

.mrc-group-scales {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mrc-group-scales-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.mrc-group-scale-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0rem;
    flex: 1;
}

/* ===============================
   Sinais Vitais (Avaliação)
   =============================== */
.vital-card {
    border: 1px solid #e5e7eb;
    border-left: 4px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
    height: 100%;
}

.vital-card:hover {
    border-color: #d1d5db;
    border-left: 4px solid #1d4ed8;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.vital-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 8px;
    letter-spacing: .02em;
}

.vital-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vital-inputs.single {
    gap: 10px;
}

.vital-sep {
    color: #6b7280;
    font-weight: 700;
}

.vital-unit {
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.vital-card .form-control {
    border-radius: 10px;
}

.mrc-group-scale-item .mrc-group-label {
    min-width: 40px;
    max-width: 40px;
    padding-top: 1.1rem;
    flex-shrink: 0;
}

.mrc-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 30px;
}

.mrc-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    margin-top: 0rem;
}

.mrc-total-badge-tetraparesia {
    background: #F42724;
    color: white;
}

.mrc-total-badge-severa {
    background: #FC6718;
    color: white;
}

.mrc-total-badge-moderada {
    background: #FF9800;
    color: white;
}

.mrc-total-badge-leve {
    background: #FFCC00;
    color: #333;
}

.mrc-total-badge-normal {
    background: #1CC633;
    color: white;
}


/* ============================================
   BUTTONS SIZES
============================================ */
/* Extra Small */
.btn-xs {
    font-size: 0.70rem;
    padding: 0.20rem 0.45rem;
    border-radius: 0.25rem;
}

/* Small */
.btn-sm {
    font-size: 0.80rem;
    padding: 0.30rem 0.65rem;
    border-radius: 0.30rem;
}

/* Medium (padrão) */
.btn-md {
    font-size: 0.90rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.375rem;
}

/* Large */
.btn-lg {
    font-size: 1.05rem;
    padding: 0.65rem 1.25rem;
    border-radius: 0.45rem;
}

/* Extra Large */
.btn-xl {
    font-size: 1.20rem;
    padding: 0.85rem 1.75rem;
    border-radius: 0.55rem;
}


.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    background-color: #cccccc78;
}

/* Prontuário: sub-abas com ativo branco e inativo cinza */
#avaliacoesSubTabs .nav-link,
#documentosSubTabs .nav-link,
#relatoriosSubTabs .nav-link,
#agendaSubTabs .nav-link {
    background-color: #e5e7eb;
    color: #374151;
    font-weight: 400;
    position: relative;
    overflow: visible;
}

#avaliacoesSubTabs .nav-link.active,
#avaliacoesSubTabs .show>.nav-link,
#documentosSubTabs .nav-link.active,
#documentosSubTabs .show>.nav-link,
#relatoriosSubTabs .nav-link.active,
#relatoriosSubTabs .show>.nav-link,
#agendaSubTabs .nav-link.active,
#agendaSubTabs .show>.nav-link {
    background-color: #ffffff;
    color: #111827;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

#avaliacoesSubTabs .nav-link.active::before,
#avaliacoesSubTabs .show>.nav-link::before,
#documentosSubTabs .nav-link.active::before,
#documentosSubTabs .show>.nav-link::before,
#relatoriosSubTabs .nav-link.active::before,
#relatoriosSubTabs .show>.nav-link::before,
#agendaSubTabs .nav-link.active::before,
#agendaSubTabs .show>.nav-link::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -7px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #d1d5db;
    opacity: 0.9;
    pointer-events: none;
}

.documentos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.documento-item {
    width: 150px;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.documento-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.documento-icon {
    font-size: 2rem;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.documento-nome {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.documento-tamanho {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.documento-acoes {
    display: flex;
    gap: 0.25rem;
}

.documento-acoes .btn {
    font-size: 0.7rem;
    padding: 0.125rem 0.25rem;
}

.mrc-movimento-card {
    border: 1px solid #dbdbdbc7;
    border-left: 4px solid #dbdbdbc7 !important;
    border-radius: 12px;
}

/* ============================================
   CUSTOM PAGINATION
============================================ */
.custom-pagination .page-item .page-link {
    border-radius: 6px !important;
    margin: 0 4px;
    border: 1px solid #e0e0e0;
    color: #4b5563;
    /* cinza */
    font-weight: 500;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.custom-pagination .page-item.active .page-link {
    background-color: #e0e7ff;
    /* fundo azul claro da imagem */
    border-color: #3b82f6;
    /* borda principal do azul */
    color: #1d4ed8;
    /* texto da cor azul */
    font-weight: 600;
}

.custom-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.custom-pagination .page-item.disabled .page-link {
    background-color: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
    box-shadow: none;
}

/* ============================================================
   MODAL PROTOCOLO FISIOTERAPÊUTICO — REDESIGN RELATÓRIO CLÍNICO
   Versão: 2.0 | Estética: Clinical Report / Medical Precision
   ============================================================ */

/* --- Diálogo e container ---------------------------------- */
.pf-modal-dialog {
    max-width: 960px;
}

.pf-modal-content {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.18) !important;
    background: #f8f9fb;
}

/* --- Cabeçalho do relatório ------------------------------- */
.pf-report-header {
    background: linear-gradient(135deg, #1a4a3c 0%, #234939 60%, #1d6b52 100%);
    padding: 1.5rem 1.75rem 1.25rem;
    position: relative;
}

.pf-report-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #34d399 0%, #10b981 50%, #059669 100%);
}

.pf-report-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pf-report-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pf-report-brand-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #a7f3d0;
    flex-shrink: 0;
}

.pf-report-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: 0.01em;
    margin-bottom: 4px !important;
}

.pf-report-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pf-badge-ia {
    display: inline-flex;
    align-items: center;
    background: rgba(52, 211, 153, 0.2);
    color: #a7f3d0;
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pf-meta-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1rem;
}

.pf-meta-text {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.8rem;
}

.pf-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pf-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.05);
}

/* --- Barra de abas ---------------------------------------- */
.pf-tab-nav-wrap {
    background: #fff;
    border-bottom: 2px solid #eef0f4;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 5;
}

.pf-tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pf-tab-nav::-webkit-scrollbar {
    display: none;
}

.pf-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.01em;
    margin-bottom: -2px;
}

.pf-tab-btn i {
    font-size: 0.85rem;
    opacity: 0.7;
}

.pf-tab-btn:hover {
    color: #234939;
    background: #f0f9f5;
}

.pf-tab-btn.active {
    color: #234939 !important;
    border-bottom-color: #234939 !important;
    font-weight: 600;
    background: none;
}

.pf-tab-btn.active i {
    opacity: 1;
}

/* Bootstrap tab syncing (mantém bootstrap tabs funcionando) */
.pf-tab-btn[aria-selected="true"] {
    color: #234939;
    border-bottom-color: #234939;
    font-weight: 600;
}

/* --- Corpo do modal --------------------------------------- */
.pf-modal-body {
    padding: 1.5rem !important;
    background: #f8f9fb;
    min-height: 420px;
}

.pf-section-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* --- Cartão de dado do resumo ----------------------------- */
.pf-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .pf-data-grid {
        grid-template-columns: 1fr;
    }
}

.pf-data-card {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    transition: box-shadow 0.18s;
    position: relative;
}

.pf-data-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.pf-data-card-full {
    grid-column: 1 / -1;
}

.pf-data-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pf-data-card-value {
    font-size: 0.92rem;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.55;
}

/* Cartão de destaque IA */
.pf-ia-card {
    background: linear-gradient(135deg, #f0fdf9 0%, #ecfdf5 100%);
    border: 1.5px solid #a7f3d0;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
}

.pf-ia-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pf-ia-card-value {
    font-size: 0.93rem;
    color: #1f2937;
    line-height: 1.6;
    font-weight: 400;
}

/* Objetivos como chips/badges */
.pf-objectives-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pf-objective-chip {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* EVA / Dor badge */
.pf-eva-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Seção com título interno (Terapias, Fases, etc.) */
.pf-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Cards de terapia ------------------------------------- */
.pf-terapia-card {
    background: #fff;
    border: 1px solid #e8edf2;
    border-left: 3.5px solid #059669;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.18s;
}

.pf-terapia-card:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.pf-terapia-header {
    padding: 0.85rem 1.15rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.pf-terapia-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pf-terapia-name-num {
    background: #059669;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
}

.pf-terapia-body {
    padding: 0 1.15rem 1rem;
    border-top: 1px solid #f3f4f6;
    display: none;
}

.pf-terapia-card.pf-open .pf-terapia-body {
    display: block;
}

.pf-terapia-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    color: #9ca3af;
    margin-top: 0.85rem;
    margin-bottom: 0.3rem;
}

.pf-terapia-text {
    font-size: 0.87rem;
    color: #374151;
    line-height: 1.6;
}

.pf-referencias-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pf-referencias-list li {
    font-size: 0.8rem;
    color: #6b7280;
    padding-left: 1rem;
    position: relative;
}

.pf-referencias-list li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: 700;
}

/* --- Cards de fases --------------------------------------- */
.pf-fase-card {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 12px;
    overflow: hidden;
}

.pf-fase-header {
    background: linear-gradient(90deg, #f0fdf9, #fff);
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid #e8edf2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pf-fase-num {
    background: #059669;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.pf-fase-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.pf-fase-body {
    padding: 1rem 1.15rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .pf-fase-body {
        grid-template-columns: 1fr;
    }
}

.pf-fase-col-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pf-fase-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pf-fase-list li {
    font-size: 0.85rem;
    color: #374151;
    padding-left: 1.1rem;
    position: relative;
    line-height: 1.4;
}

.pf-fase-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #059669;
}

/* Cartão de sessões (info geral do plano) */
.pf-sessoes-card {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
}

.pf-sessoes-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.pf-sessao-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pf-sessao-metric-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
}

.pf-sessao-metric-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #059669;
    line-height: 1;
}

.pf-sessao-metric-unit {
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 500;
}

/* --- Financeiro ------------------------------------------ */
.pf-fin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
    .pf-fin-grid {
        grid-template-columns: 1fr;
    }
}

.pf-fin-metric-card {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 10px;
    padding: 1rem 1.15rem;
}

.pf-fin-metric-card.pf-fin-highlight {
    background: linear-gradient(135deg, #f0fdf9, #ecfdf5);
    border-color: #a7f3d0;
}

.pf-fin-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    margin-bottom: 0.35rem;
}

.pf-fin-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1f2937;
}

.pf-fin-value.pf-fin-green {
    color: #059669;
}

.pf-fin-note {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 10px;
    padding: 1rem 1.15rem;
}

/* --- Observações importantes ----------------------------- */
.pf-obs-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pf-obs-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #fef08a;
    border-left: 3.5px solid #f59e0b;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.55;
}

.pf-obs-icon {
    color: #f59e0b;
    font-size: 0.85rem;
    margin-top: 2px;
    flex-shrink: 0;
}

/* --- Empty state ----------------------------------------- */
.pf-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #9ca3af;
}

.pf-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.35;
}

.pf-empty-state p {
    margin: 0;
    font-size: 0.875rem;
}

/* --- Rodapé ---------------------------------------------- */
.pf-modal-footer {
    background: #fff;
    border-top: 1px solid #e8edf2 !important;
    padding: 0.9rem 1.5rem !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.pf-footer-note {
    font-size: 0.77rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pf-btn-fechar {
    background: #1a4a3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pf-btn-fechar:hover {
    background: #234939;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 74, 60, 0.25);
}

/* Accordion expandir para terapias */
.pf-terapia-chevron {
    color: #9ca3af;
    font-size: 0.8rem;
    transition: transform 0.22s ease;
    flex-shrink: 0;
    margin-top: 3px;
}

.pf-terapia-card.pf-open .pf-terapia-chevron {
    transform: rotate(-180deg);
}

/* --- Botao PDF --- */
.pf-btn-pdf {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.pf-btn-pdf:hover {
    background: #0ea5e9;
    color: #ffffff;
    border-color: #0ea5e9;
}

/* --- Chips de Regiões Afetadas --- */
.pf-regioes-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.pf-regiao-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    background: #f8fafc00;
    border: 1px solid #e2e8f0;
    color: #334155;
    transition: all 0.2s ease;
}

.pf-regiao-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pf-regiao-chip-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 0.1rem;
    font-size: 0.75rem;
}



/* ===================================
   Wizard steps indicator for Protocolo Inteligente
   =================================== */
/* Wizard steps indicator */
.wizard-steps {
    display: flex;
    align-items: center;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s;
}

.wizard-step.active {
    color: #fff;
}

.wizard-step.done {
    color: rgba(255, 255, 255, 0.9);
}

.wizard-step .step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}

.wizard-step.active .step-circle {
    background: #fff;
    color: #0d6efd;
    border-color: #fff;
}

.wizard-step.done .step-circle {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
}

.wizard-step small {
    font-size: 11px;
    white-space: nowrap;
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin-top: -14px;
}

/* Region checkboxes */
.card-region-btn {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    background: #fff;
    white-space: nowrap;
    overflow: hidden;
}

.card-region-btn:has(input:checked) {
    border-color: #0d6efd;
    background: #eef3ff;
    color: #0d6efd;
    font-weight: 600;
}

.card-region-btn:hover {
    border-color: #0d6efd80;
    background: #f8f9ff;
}

/* Section title */
.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #344;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

/* AI loading animation */
.ai-brain-pulse {
    display: inline-block;
    animation: brainPulse 1.5s ease-in-out infinite;
}

@keyframes brainPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* Resumo step 4 */
.resumo-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid #0d6efd;
}

.resumo-card .resumo-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.resumo-card .resumo-value {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

/* Modal de escolha (Gerar Protocolo) sempre na frente quando aberta */
.modal-escolha-gerar-protocolo {
    z-index: 2060 !important;
}

.modal-escolha-gerar-protocolo~.modal-backdrop {
    z-index: 2055 !important;
}

body:has(.modal-escolha-gerar-protocolo.show) .modal-backdrop:last-of-type {
    z-index: 2055 !important;
}


.mdi-2x {
    font-size: 2em;
}

.mdi-3x {
    font-size: 3em;
}

.mdi-4x {
    font-size: 4em;
}

.mdi-5x {
    font-size: 5em;
}

.hover-elevate:hover {
    transform: translateY(-5px);
}

.transition-all {
    transition: all 0.3s ease;
}

/*** Modal com desfoque de fundo ***/
.modal-backdrop.show {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px) brightness(1);
    -webkit-backdrop-filter: blur(10px) brightness(0.8);
}

.progress-sm {
    height: 8px;
}

.progress-md {
    height: 16px;
}

.progress-lg {
    height: 24px;
}

.progress-xl {
    height: 32px;
}

/* SweetAlert: motivo do reagendamento — garantir que fique acima de modais e o textarea seja clicável */
.swal2-reagendar-container {
    z-index: 9999 !important;
}

.swal2-reagendar-motivo {
    z-index: 10000 !important;
}

.swal2-reagendar-container .swal2-textarea {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

/* SweetAlert: desfazer pagamento (financeiro prontuário) — acima do modal Bootstrap */
.swal2-financeiro-desfazer-container {
    z-index: 9999 !important;
}

.swal2-financeiro-desfazer-popup {
    z-index: 10000 !important;
}

.swal2-financeiro-desfazer-container .swal2-textarea {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

/* Prontuário: foto do paciente — botão "Trocar foto" centralizado abaixo, sobrepondo para cima */
.prontuario-foto-paciente-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.prontuario-foto-paciente-wrapper .prontuario-foto-paciente-img {
    display: block;
}

.prontuario-foto-paciente-btn-wrap {
    margin-top: -14px;
    position: relative;
    z-index: 1;
}

.prontuario-foto-paciente-img:focus {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}



#evolucaoViewerBody .mrc-scale-item .mrc-number {
    margin-top: -5px;
}

#evolucaoViewerBody .mrc-scale-item .mrc-descricao {
    line-height: 1 !important;
    margin-top: -5px !important;
}

/* Dashboard: Próximas Sessões — cards compactos */
.dashboard-proximas-sessoes-cards .dashboard-prox-sessao-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    padding-bottom: 1rem !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.dashboard-proximas-sessoes-cards .dashboard-prox-sessao-card:hover {
    opacity: 0.97;
    transform: translateY(-1px);
}

.dashboard-proximas-sessoes-cards .dashboard-prox-sessao-meta {
    line-height: 1.2;
}


.dashboard-proximas-sessoes-cards .dashboard-prox-sessao-badge {
    position: absolute;
    left: 50%;
    bottom: 0rem;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
}

.dashboard-proximas-sessoes-cards .dashboard-prox-sessao-ev {
    line-height: 1;
    min-width: 1.5rem;
}

.dashboard-proximas-sessoes-cards .dashboard-prox-sessao-ev .mdi {
    font-size: 1.15rem;
    vertical-align: middle;
}

/* Rodapé do card (badge e botão) sempre na base */
.dashboard-proximas-sessoes-cards .dashboard-prox-sessao-bottom {
    margin-top: auto;
    padding-top: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-height: 1rem;
}