@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

/* --- LOGIN PAGE PREMIUM STYLES --- */
.login-body {
    background: url('../images/login_bg.png') no-repeat center center fixed;
    background-size: cover;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* --- MAINTENANCE NAVIGATION (PILLS) --- */
.maintenance-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-pill {
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-pill:hover {
    background: rgba(13, 148, 136, 0.05);
    transform: translateY(-1px);
    color: var(--primary-color);
}

.btn-pill.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.btn-pill-register {
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-pill-register:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
}

.btn-pill-register.active {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.btn-pill-edit {
    border-color: #f59e0b;
    color: #f59e0b;
}

.btn-pill-edit:hover {
    background: rgba(245, 158, 11, 0.05);
    color: #f59e0b;
}

.btn-pill-edit.active {
    background: #f59e0b;
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

.btn-pill-delete {
    border-color: #ef4444;
    color: #ef4444;
}

.btn-pill-delete:hover {
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
}

.btn-pill-delete.active {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

:root {
    --primary-color: #0d9488;
    /* Teal 600 - Clinical & Professional */
    --primary-light: #14b8a6;
    /* Teal 500 */
    --accent-color: #db2777;
    /* Pink 600 - Soft & Welcoming */
    --accent-hover: #be185d;
    /* Pink 700 */
    --bg-main: #fdf2f8;
    /* Pink 50 - Very subtle warm wash */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border-color: #f1f5f9;
    /* Slate 100 */
    --sidebar-width: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(at 0% 0%, hsla(333, 71%, 95%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(177, 85%, 95%, 1) 0, transparent 50%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--primary-color);
}

/* Navbar Modernization */
.navbar-dark.bg-dark {
    background: rgba(13, 148, 136, 0.95);
    /* Semi-transparent Teal */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 70px;
}

.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em;
}

/* Sidebar Modernization */
#sidebarMenu {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(13, 148, 136, 0.05);
    box-shadow: var(--shadow-sm);
    padding-top: 50px !important;
    /* Increased from 30px */
}

.sidebar-heading {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--primary-color) !important;
    opacity: 0.6;
    padding: 0 24px 10px;
    margin-top: 30px;
    /* Increased from 20px */
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--text-main);
    padding: 12px 20px;
    margin: 2px 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.sidebar .nav-link:hover {
    background-color: #ffffff;
    color: var(--accent-color);
    box-shadow: var(--shadow-sm);
    border-color: rgba(219, 39, 119, 0.1);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover)) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.25);
    border: none;
}

.sidebar .nav-link .feather {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

/* Fix for clumped pagination buttons in BS5 */
.dataTables_wrapper .pagination .page-item {
    margin: 0 2px;
}

.dataTables_wrapper .pagination .page-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm) !important;
    border: 1px solid #e2e8f0;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: #fff;
    text-decoration: none;
}

.dataTables_wrapper .pagination .page-item.active .page-link {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(219, 39, 119, 0.2);
}

.dataTables_wrapper .pagination .page-item:not(.active):hover .page-link {
    background-color: var(--bg-main);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    /* Fallback for non-BS5 or mixed rendering */
    display: inline-block;
    padding: 6px 14px !important;
    margin-left: 5px !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: var(--text-main) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

/* Cards & Containers */
main {
    padding-top: 30px !important;
    padding-bottom: 50px !important;
}

.card,
.table-responsive,
#wrap {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(13, 148, 136, 0.05);
    box-shadow: var(--shadow-lg);
    padding: 30px;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

/* Table Modernization */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: #fcfdfe;
    border-bottom: 2px solid var(--bg-main);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 15px 20px;
}

.table tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--bg-main);
    vertical-align: middle;
    font-size: 0.92rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(253, 242, 248, 0.3);
}

#tabla_reportes tbody tr:hover {
    background-color: rgba(13, 148, 136, 0.03);
}

/* Cellular column - Force single line */
#tabla_reportes td:nth-child(5) {
    white-space: nowrap !important;
    font-weight: 600;
    color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 24px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(219, 39, 119, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(219, 39, 119, 0.3);
}

/* Custom Accordion for Menu - Clean & Minimal */
.accordion-item {
    border: none;
    background: transparent;
}

.accordion-button {
    background: transparent !important;
    color: var(--text-main) !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 15px 24px;
    border-radius: 0 !important;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color) !important;
    box-shadow: none;
}

.accordion-button::after {
    filter: grayscale(1) invert(0.2);
}

.accordion-body {
    padding: 0 0 10px 0;
}

/* Form Controls */
.form-control,
.form-select {
    border: 1.5px solid #f1f5f9;
    background-color: #fcfdfe;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(219, 39, 119, 0.08);
}

/* Calendar Specific Styles */
.bg-calendario_blue {
    background-color: rgba(13, 148, 136, 0.1) !important;
    color: var(--primary-color);
}

.bg-calendario_green {
    background-color: rgba(20, 184, 166, 0.05) !important;
}

.bg-calendario_yellow {
    background-color: rgba(253, 224, 71, 0.1) !important;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

.bg-success {
    background-color: #10b981 !important;
}

.bg-danger {
    background-color: #ef4444 !important;
}

.bg-secondary {
    background-color: #94a3b8 !important;
}

/* --- PREMIUM AGENDA STYLES --- */
:root {
    --status-pending: #94a3b8;
    --status-confirmed: #8b5cf6;
    --status-finished: #10b981;
    --status-noshow: #ef4444;
    --day-blue-dark: #075985;
    --day-blue-light: #0ea5e9;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.agenda-wrapper {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.agenda-title-group h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #1e293b;
    font-family: 'Outfit', sans-serif !important;
}

.agenda-title-group p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.agenda-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.dot-pending {
    background-color: #FFFF7D;
}

.dot-confirmed {
    background-color: var(--status-confirmed);
}

.dot-finished {
    background-color: var(--status-finished);
}

.dot-noshow {
    background-color: var(--status-noshow);
}

.agenda-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #f1f5f9;
    padding: 12px 24px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.nav-arrows {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-nav {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    transition: all 0.2s;
    text-decoration: none !important;
}

.btn-nav:hover {
    background: #f8fafc;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.date-display {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 140px;
    justify-content: center;
}

.date-display:hover {
    border-color: var(--primary-color);
    background-color: #f8fafc;
}

.calendar-icon {
    width: 18px;
    height: 18px;
    color: #1e293b;
    stroke-width: 2.5px;
}

.date-display input[type="date"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* DataTables Custom Spacing */
.length-filter-container {
    margin-bottom: 1.5rem !important;
}

.dataTables_length select,
.dataTables_filter input {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 4px 8px !important;
}

.dataTables_length {
    margin-bottom: 10px;
}

.dataTables_filter {
    margin-bottom: 10px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.filter-group .form-select {
    width: 250px;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.btn-add-cita {
    background: #074e8c !important;
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(7, 78, 140, 0.3);
    text-decoration: none !important;
}

.btn-add-cita:hover {
    opacity: 0.9;
    color: #fff !important;
    transform: translateY(-2px);
}

/* Agenda Table Enhancements */
.table-agenda {
    border-collapse: separate !important;
    border-spacing: 4px !important;
    background-color: #f8fafc !important;
    border: none !important;
    table-layout: fixed;
    width: 100%;
}

.table-agenda thead th {
    padding: 12px !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border: none !important;
}

.th-day {
    color: #fff !important;
}

.th-day-1 {
    background-color: #0c4a6e !important;
}

.th-day-2 {
    background-color: #0284c7 !important;
}

.th-doctor {
    background-color: #bae6fd !important;
    color: #0369a1 !important;
    font-weight: 700 !important;
}

.td-hour {
    font-weight: 600 !important;
    color: #64748b !important;
    background: #fff !important;
    width: 80px !important;
    vertical-align: middle !important;
    border: 1px solid #f1f5f9 !important;
}

.td-slot {
    width: 160px;
    height: 80px;
    padding: 4px !important;
    background-color: #f1f5f9 !important;
    vertical-align: middle !important;
    border: none !important;
}

.appointment-card {
    background: #fff;
    border-radius: 8px;
    padding: 6px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    position: relative;
    box-shadow: var(--card-shadow);
    border: 1px solid #f1f5f9;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.appointment-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-indicator {
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 10px;
}

.card-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 12px;
}

.card-content {
    text-align: center;
    width: 100%;
}

.patient-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: #1e293b;
    line-height: 1.2;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Removed unused .treatment-label */

/* Removed .card-actions-vertical */

.action-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s;
    color: #94a3b8;
}

.action-icon:hover {
    opacity: 0.7;
    color: var(--primary-color);
}

.action-icon.text-danger:hover {
    color: #ef4444;
}

/* Status Variants */
.status-pending .card-indicator {
    background-color: var(--status-pending);
}

.status-pending {
    background-color: #FFFF7D;
}

.status-confirmed .card-indicator {
    background-color: var(--status-confirmed);
}

.status-confirmed {
    background-color: #75009E;
}

.status-finished .card-indicator {
    background-color: var(--status-finished);
}

.status-finished {
    background-color: #098000;
}

.status-noshow .card-indicator {
    background-color: var(--status-noshow);
}

.status-noshow {
    background-color: #BA0000;
}

/* Empty Slots */
.empty-slot {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    text-decoration: none !important;
    transition: all 0.2s;
}

.empty-slot:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.empty-slot svg {
    width: 20px;
    height: 20px;
}