/* Tempus - Custom CSS */

:root {
    --primary: #1e78d1;
    --primary-dark: #155fa8;
    --primary-light: #4192e3;
    --primary-gradient: linear-gradient(135deg, #1976D2 0%, #1A237E 100%);
    
    --secondary: #f0d800;
    --secondary-dark: #e6cc00;
    --secondary-light: #ffe229;
    
    --dark: #121212;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --gray-dark: #343a40;
    
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    
    --border-radius: 0.5rem;
    --card-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --sidebar-width: 260px;
}

html, body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f8f9fa;
    color: var(--dark);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container-fluid, .container {
    max-width: 100%;
    padding-right: var(--bs-gutter-x, 0.75rem);
    padding-left: var(--bs-gutter-x, 0.75rem);
}

/* Navbar */
.navbar.bg-dark {
    background-color: var(--dark) !important;
    background-image: none;
}

/* Ajuste de posicionamento dos dropdowns */
.dropdown-menu {
    top: calc(100% + 15px) !important;
    margin-top: 50px !important; /* Margem superior aumentada conforme solicitado */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.navbar.bg-primary {
    background-color: var(--primary) !important;
    background-image: none;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

.navbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 56px 0 0;
    width: var(--sidebar-width);
    background-color: var(--light);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 56px);
    padding-top: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .user-profile {
    padding: 1.25rem 1rem;
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.sidebar .user-profile .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    overflow: hidden;
    border: 3px solid var(--secondary);
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 500;
}

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

.sidebar .user-profile h6 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.sidebar .user-profile p {
    color: var(--gray);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--gray-dark);
    padding: 0.85rem 1.25rem;
    border-left: 3px solid transparent;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link i {
    margin-right: 8px;
    color: var(--gray);
    transition: all 0.2s ease;
    width: 20px;
    text-align: center;
}

.sidebar .nav-link.active {
    color: var(--primary);
    background-color: rgba(30, 120, 209, 0.05);
    border-left-color: var(--primary);
}

.sidebar .nav-link:hover {
    color: var(--primary);
    background-color: rgba(30, 120, 209, 0.05);
}

.sidebar .nav-link.active i,
.sidebar .nav-link:hover i {
    color: var(--primary);
}

/* Main content */
main {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0;  /* Mudado de '0 auto' para '0' para alinhar à esquerda */
    width: 100%;
    flex: 1;
}

/* Footer */
footer {
    margin-top: auto;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    z-index: 10;
    position: relative;
    bottom: 0;
}

@media (min-height: 100vh) {
    footer {
        position: sticky;
        bottom: 0;
    }
}

/* Card customization */
.card {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--card-box-shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.25rem 1.5rem;
}

.card-footer {
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem 1.5rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0;
}

/* Card personalizado da tela de dentistas */
.dentist-card-body {
    /* Removido altura fixa e overflow para permitir crescimento natural */
}

/* Correção do posicionamento dos dropdowns na tela de dentistas */
.dentist-card-body .dropdown-menu {
    position: absolute !important;
    top: 35px !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0 !important;
    transform: none !important;
    z-index: 1050 !important;
}

/* Container da tabela sem scroll horizontal */
.dentist-card-body .table-container {
    width: 100%;
    overflow: visible;
}

/* Ajustar largura da tabela para evitar overflow */
.dentist-card-body .table {
    table-layout: fixed;
    width: 100%;
}

.dentist-card-body .table th,
.dentist-card-body .table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Larguras específicas das colunas */
.dentist-card-body .table th:nth-child(1),
.dentist-card-body .table td:nth-child(1) { width: 15%; } /* Nome */
.dentist-card-body .table th:nth-child(2),
.dentist-card-body .table td:nth-child(2) { width: 22%; } /* Email */
.dentist-card-body .table th:nth-child(3),
.dentist-card-body .table td:nth-child(3) { width: 15%; } /* CPF/CNPJ */
.dentist-card-body .table th:nth-child(4),
.dentist-card-body .table td:nth-child(4) { width: 8%; }  /* CRO */
.dentist-card-body .table th:nth-child(5),
.dentist-card-body .table td:nth-child(5) { width: 7%; }  /* Estado */
.dentist-card-body .table th:nth-child(6),
.dentist-card-body .table td:nth-child(6) { width: 12%; } /* Status */
.dentist-card-body .table th:nth-child(7),
.dentist-card-body .table td:nth-child(7) { width: 21%; } /* Ações - aumentada para acomodar botões */

/* Estilização dos botões de ação */
.dentist-card-body .d-flex.gap-1 .btn {
    min-width: 32px;
    height: 32px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-width: 1px;
}

/* Responsividade para telas menores */
@media (max-width: 1200px) {
    .dentist-card-body .table th:nth-child(2),
    .dentist-card-body .table td:nth-child(2) { width: 18%; }
    .dentist-card-body .table th:nth-child(7),
    .dentist-card-body .table td:nth-child(7) { width: 25%; }
}

/* Button customization */
.btn {
    border-radius: 0.4rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: var(--dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-outline-secondary {
    color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: var(--dark);
}

/* Form customization */
.form-control,
.form-select {
    border-radius: 0.4rem;
    padding: 0.6rem 1rem;
    border-color: #ced4da;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus,
.btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(30, 120, 209, 0.25);
    border-color: var(--primary);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Dashboard stats */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    font-size: 2.25rem;
    opacity: 0.8;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    border-top: none;
    white-space: nowrap;
    color: var(--gray-dark);
    background-color: #f8f9fa;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(30, 120, 209, 0.05);
}

/* Tooth selector */
.tooth-selector {
    margin: 20px auto;
    max-width: 100%;
    position: relative;
}

.tooth-selector svg {
    max-width: 100%;
    height: auto;
}

.tooth-selector .tooth {
    cursor: pointer;
    transition: fill 0.2s ease;
    fill: #ffffff;
    stroke: #333333;
    stroke-width: 1;
}

.tooth-selector .tooth:hover {
    fill: rgba(30, 120, 209, 0.2);
}

.tooth-selector .tooth.tooth-selected,
.tooth-selector .tooth.selected {
    fill: #1a91ff;
}

/* Form builder */
.form-builder-field {
    padding: 1.25rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

.form-builder-field:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-builder-field .field-actions {
    display: flex;
    gap: 0.5rem;
}

/* Login and register pages */
.auth-card {
    margin: 3rem auto;
    max-width: 30rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.auth-card .card-header {
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    padding: 2rem 1.5rem;
}

.auth-card .card-header h3 {
    margin: 0;
    font-weight: 700;
}

.auth-card .card-body {
    padding: 2.5rem;
}

.auth-card .card-footer {
    padding: 1.5rem;
    text-align: center;
    background-color: #f8f9fa;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand img {
    height: 80px;
    margin-bottom: 1rem;
}

/* Progress bars */
.progress {
    border-radius: 50rem;
    overflow: hidden;
    height: 1rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 50rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.7em;
    border-radius: 0.25rem;
}

/* User dropdown in header */
.user-dropdown {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--bs-white);
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: auto;
    transform-origin: top right;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
    object-fit: cover;
    overflow: hidden;
}

.navbar-user-info {
    margin-right: 0.5rem;
}

.navbar {
    height: 56px;
    overflow: visible;
}

.dropdown-menu-end {
    position: absolute;
    left: auto;
    right: 0;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        width: 0;
        padding-top: 56px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        width: var(--sidebar-width);
        transform: translateX(0);
    }
    
    main {
        margin-left: 0;
        padding: 1.5rem;
        width: 100%;
    }
    
    .content-wrapper {
        padding: 0;
        width: 100%;
    }
    
    footer {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        padding-top: 0;
    }
    
    .sidebar-sticky {
        height: 100%;
    }
    
    .card-responsive {
        margin-bottom: 1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .card-header, 
    .card-body,
    .card-footer {
        padding: 1rem;
    }
}

/* User profile page */
.profile-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid white;
    background-color: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-right: 2rem;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 767.98px) {
    .profile-header {
        text-align: center;
        padding: 1.5rem;
    }
    
    .profile-avatar {
        margin: 0 auto 1.5rem;
    }
}

.profile-info h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.profile-info p {
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.profile-stats .card {
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
    margin-bottom: 1rem;
}

.profile-tab-content {
    padding: 1.5rem;
}