/* Modern Elevation Design System for Centro Pasos y Palabras */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0ea5e9;
    /* Sky Blue */
    --primary-light: #e0f2fe;
    --secondary: #64748b;
    /* Slate 500 */
    --accent: #22d3ee;
    /* Cyan */
    --dark: #0f172a;
    /* Slate 900 */
    --light-bg: #f8fafc;
    /* Slate 50 */
    --card-bg: #ffffff;
    --sidebar-bg: #111827;
    /* Gray 900 - Premium Dark */
    --sidebar-hover: #1f2937;
    /* Gray 800 */
    --sidebar-active: #3b82f6;
    /* Blue 500 */
    --text-main: #1f2937;
    --text-muted: #64748b;
    --border-color: #f1f5f9;
    --border-radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    background-color: var(--light-bg) !important;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Wrapper and Layout */
.wrapper {
    background-color: transparent !important;
}

.content-wrapper {
    background-color: var(--light-bg) !important;
    padding: 20px 30px;
}

/* Sidebar Styling */
.main-sidebar {
    background-color: var(--sidebar-bg) !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.sidebar-menu {
    padding: 10px 0 !important;
}

/* Sidebar Menu Items */
.sidebar-menu>li {
    margin-bottom: 2px;
}

.sidebar-menu>li>a {
    padding: 14px 20px !important;
    margin: 4px 12px !important;
    border-radius: 12px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: #94a3b8 !important;
    /* Slate 400 */
    font-weight: 500 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
}

.sidebar-menu>li>a i {
    font-size: 17px !important;
    width: 25px;
    text-align: center;
    margin-right: 10px;
    transition: transform 0.2s;
}

.sidebar-menu>li:hover>a {
    background-color: var(--sidebar-hover) !important;
    color: #f8fafc !important;
}

.sidebar-menu>li.active>a {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
    font-weight: 700 !important;
}

.sidebar-menu>li.active>a i {
    color: #3b82f6 !important;
    transform: scale(1.1);
}

/* Treeview / Sub-menus */
.treeview-menu {
    background: transparent !important;
    padding-left: 10px !important;
    padding-bottom: 10px !important;
}

.treeview-menu>li>a {
    padding: 10px 20px !important;
    margin: 2px 12px !important;
    border-radius: 10px !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    transition: all 0.2s ease !important;
}

.treeview-menu>li>a:hover,
.treeview-menu>li.active>a {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f8fafc !important;
}

.treeview-menu>li>a i {
    font-size: 12px !important;
    margin-right: 12px !important;
}

/* Main Header & Navbar Improvements */
.main-header {
    max-height: 70px !important;
    z-index: 1030 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

.fixed .content-wrapper,
.fixed .main-sidebar,
.fixed .right-side {
    padding-top: 70px !important;
}

.main-header .navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    min-height: 70px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin-left: 230px !important;
    position: relative !important;
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out !important;
}

/* 3-column flex layout for navbar */
.navbar-section {
    display: flex !important;
    align-items: center !important;
}
.navbar-left {
    flex: 1 !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
}
.navbar-center {
    flex: 0 0 auto !important;
    font-weight: 800 !important;
    font-size: 18px !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    padding: 0 15px !important;
    text-align: center !important;
}
.navbar-right-section {
    flex: 1 !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    padding-right: 8px !important;
}

/* Action button in navbar */
.navbar-action-btn {
    height: 38px !important;
    border-radius: 10px !important;
    padding: 0 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #3b82f6 !important;
    border: none !important;
    color: white !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

.sidebar-collapse .main-header .navbar,
.sidebar-collapse .content-wrapper,
.sidebar-collapse .main-footer {
    margin-left: 50px !important;
}

.sidebar-collapse .main-header .logo {
    width: 50px !important;
    padding: 0 !important;
}

.sidebar-collapse .logo-lg {
    display: none !important;
}

.sidebar-collapse .main-sidebar {
    transform: translate(0, 0) !important;
    width: 50px !important;
}

/* Sidebar Menu Collapsed Styles */
.sidebar-collapse .sidebar-menu>li>a {
    padding: 14px 0 !important;
    margin: 4px 0 !important;
    text-align: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
}

.sidebar-collapse .sidebar-menu>li>a i {
    margin-right: 0 !important;
    font-size: 20px !important;
}

.sidebar-collapse .sidebar-menu>li>a span {
    display: none !important;
}

.main-header .logo {
    height: 70px !important;
    line-height: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    background-color: var(--sidebar-bg) !important;
    border-bottom: none !important;
}

.sidebar-toggle {
    float: none !important;
    padding: 15px !important;
    color: #64748b !important;
    font-size: 18px !important;
}

.nav-search-container {
    margin-left: 10px !important;
    display: flex !important;
    align-items: center !important;
}

.navbar-custom-menu {
    float: none !important;
    display: flex !important;
    align-items: center !important;
}

.navbar-nav {
    display: flex !important;
    align-items: center !important;
}

.navbar-nav>li>a {
    padding-top: 25px !important;
    padding-bottom: 25px !important;
    color: #64748b !important;
}

.navbar-nav>li>a:hover {
    background: #f8fafc !important;
    color: var(--primary) !important;
}

/* Box / Card Styling */
.box {
    border: none !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-md) !important;
    margin-bottom: 30px !important;
    overflow: visible;
    background: #ffffff !important;
    transition: box-shadow 0.3s ease !important;
}

/* Allow dropdowns to overflow table containers */
.box .box-body {
    overflow: visible !important;
}

.box .no-padding {
    overflow: visible !important;
}

table.dataTable {
    overflow: visible !important;
}

table tbody tr td {
    overflow: visible !important;
}

/* Dropdown inside tables must be above everything */
table .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

table .dropdown {
    position: relative !important;
}

.box:hover {
    box-shadow: var(--shadow-lg) !important;
}

/* Info Box Styling */
.info-box {
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid rgba(0, 0, 0, 0.03) !important;
    overflow: hidden;
    background: #ffffff !important;
    min-height: 100px !important;
}

.info-box-icon {
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 35px !important;
    width: 90px !important;
    height: 100px !important;
}

.info-box-content {
    padding: 15px 20px !important;
    margin-left: 90px !important;
}

.info-box-text {
    text-transform: uppercase !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    letter-spacing: 0.5px !important;
    font-size: 11px !important;
}

.info-box-number {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    margin-top: 5px !important;
}

.box-header {
    border-bottom: 1px solid #f1f1f1 !important;
    padding: 15px 20px !important;
}

.box-title {
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    color: var(--primary) !important;
}

.box-body {
    padding: 20px !important;
}

.box-footer {
    background-color: #fafbfc !important;
    border-top: 1px solid #f1f1f1 !important;
    padding: 15px 20px !important;
}

/* Form Controls */
.form-control {
    border-radius: 8px !important;
    border: 1px solid #dcdde1 !important;
    padding: 10px 15px !important;
    height: 45px !important;
    box-shadow: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.form-control:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1) !important;
}

/* Buttons */
.btn {
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
}

.btn-primary {
    background-color: var(--primary) !important;
    border: none !important;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.2) !important;
}

.btn-primary:hover {
    background-color: var(--secondary) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 12px rgba(44, 62, 80, 0.3) !important;
}

.btn-success {
    background-color: var(--accent) !important;
    border: none !important;
}

/* DataTables Styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
}

table.dataTable thead th {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #eee !important;
    padding: 15px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
}

/* Tables Modern */
.table thead th {
    background: transparent !important;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color) !important;
    padding: 15px 20px !important;
}

table.dataTable tbody td {
    padding: 15px 20px !important;
    vertical-align: middle !important;
    border-top: 1px solid #f1f1f1 !important;
}

.table tbody td {
    border-top: 1px solid var(--border-color) !important;
    padding: 15px 20px !important;
    vertical-align: middle !important;
    color: var(--text-main);
    font-size: 13px;
}

.table tr:last-child td {
    border-bottom: none !important;
}

/* Flexbox utility for action buttons in tables */
.td-actions {
    display: flex !important;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
    width: 1%;
    /* Shrink wrap to content */
    min-width: fit-content;
}

/* Smaller padding for utility/table buttons */
.btn-xs,
.btn-group-xs>.btn {
    padding: 6px 14px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
}

.btn-sm,
.btn-group-sm>.btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
}

/* Dashboard Upcoming List */
.upcoming-list li a {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.upcoming-list li a:hover {
    background: #fcfcfc !important;
    border-left-color: var(--primary);
    padding-left: 18px !important;
}

.upcoming-list .label {
    font-size: 10px !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    letter-spacing: 0.2px;
}

.upcoming-list .label-primary {
    background-color: var(--primary) !important;
}

.upcoming-list .label-success {
    background-color: #27ae60 !important;
}

.upcoming-list .label-danger {
    background-color: #e74c3c !important;
}

/* Notifications / Messages Menu Improvements */
.messages-menu .dropdown-menu {
    width: 350px !important;
}

.dropdown-menu>li.header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f0f0f0;
    color: #333 !important;
    font-weight: 600;
    padding: 10px 15px !important;
}

.messages-menu .menu>li>a {
    border-bottom: 1px solid #f8f9fa !important;
    transition: background 0.2s ease;
    padding: 12px 15px !important;
}

.messages-menu .menu>li>a:hover {
    background: #fcfcfc !important;
}

.messages-menu .menu>li>a h4 {
    margin: 0 0 5px 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #444 !important;
}

.messages-menu .menu>li>a p {
    font-size: 12px !important;
    color: #777 !important;
    margin: 0 !important;
    white-space: normal !important;
    /* Allow message to wrap */
    line-height: 1.4;
}

.messages-menu .menu>li>a small {
    color: #999 !important;
}

.dropdown-menu>li.footer>a {
    background: #f9fafb !important;
    color: var(--primary) !important;
    font-weight: 500;
    font-size: 12px;
    padding: 10px !important;
    border-top: 1px solid #f0f0f0;
}

.dropdown-menu>li.footer>a:hover {
    background: #ffffff !important;
    text-decoration: underline !important;
}

.messages-menu .menu>li>a i,
.box-comment i {
    font-size: 14px !important;
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

.messages-menu .menu>li>a .pull-left,
.box-comment .pull-left {
    margin-top: 2px;
}

.td-actions .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    padding: 5px 0;
    min-width: 140px;
}

.td-actions .dropdown-menu li a {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
}

.td-actions .dropdown-menu li a i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: #888;
}

.td-actions .dropdown-menu li a:hover {
    background-color: #f8f9fa;
    color: var(--primary);
}

.td-actions .dropdown-menu li a:hover i {
    color: var(--primary);
}

/* Footer Improvements */
.main-footer {
    background: #fff !important;
    border-top: 1px solid #f0f0f0 !important;
    padding: 15px 25px !important;
    color: #888 !important;
    font-size: 13px !important;
    transition: all 0.3s ease;
}

.main-footer strong {
    font-weight: 500;
}

.main-footer b {
    color: #555;
    font-weight: 600;
}

/* Ensure sidebar covers full height */
.main-sidebar {
    position: fixed !important;
    height: 100vh !important;
    overflow-y: auto;
}

.content-wrapper {
    min-height: calc(100vh - 51px - 51px) !important;
    transition: margin-left 0.3s ease-in-out !important;
}

@media (min-width: 768px) {
    .main-footer {
        margin-left: 230px !important;
        transition: margin-left 0.3s ease-in-out !important;
    }
}

/* Pagination Modern */
.dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    border: 1px solid #f1f5f9 !important;
    background: #fff !important;
    padding: 6px 12px !important;
    margin: 0 2px !important;
    color: var(--text-muted) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    background: linear-gradient(135deg, #22d3ee, #06b6d4) !important;
    color: #fff !important;
    border: none !important;
}

.dataTables_paginate .paginate_button:hover:not(.current) {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

.dataTables_info {
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 15px !important;
}

/* Global Typography Extensions */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dark);
    font-weight: 700;
}

.section-header {
    margin-bottom: 25px;
    display: flex;
    justify-content: flex-end;
    /* Align buttons to the right since title is in navbar */
    align-items: center;
    min-height: 40px;
}

.section-title,
.section-subtitle {
    display: none !important;
}

.navbar-page-title {
    font-family: 'Inter', sans-serif !important;
    letter-spacing: -0.5px;
}

/* DataTables Global Refinement */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    background: var(--gray-bg) !important;
    margin-left: 10px !important;
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 5px 10px !important;
    margin: 0 8px !important;
    font-size: 13px;
    background: #fff;
}

/* Removed redundant sidebar styles */

.main-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

.fixed .content-wrapper,
.fixed .main-sidebar {
    padding-top: 70px !important;
}

/* Box / Card Modernization */
.box {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.02) !important;
    margin-bottom: 25px;
}

.box-header.with-border {
    border-bottom: 1px solid var(--border-color) !important;
}

/* Fix for overlapping sidebar in some views */
.main-sidebar {
    padding-top: 70px !important;
    /* Matches main-header height */
}

.p-20 {
    padding: 25px 30px;
}

.login-page {
    background: url('../img/login-bg.png') no-repeat center center fixed !important;
    background-size: cover !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    overflow: hidden;
}

.login-page .wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.4);
    z-index: 1;
}

.login-box {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85) !important;
    padding: 60px 50px !important;
    border-radius: 28px !important;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    width: 460px !important;
    margin: auto !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.login-logo a {
    color: var(--primary) !important;
    font-weight: 800 !important;
    letter-spacing: -1px;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Modal Styling */
.modal-content {
    border-radius: 15px !important;
    border: none !important;
    box-shadow: var(--shadow-md) !important;
}

.modal-header {
    border-bottom: 1px solid #eee !important;
    padding: 20px !important;
}

/* Small adjustments */
.label {
    border-radius: 4px !important;
    font-weight: 500 !important;
}

.skin-black .main-header .navbar .sidebar-toggle:hover {
    background-color: #f1f1f1 !important;
}

/* Footer refinements */
.main-footer {
    background: #fff !important;
    border-top: 1px solid #eee !important;
    padding: 15px 30px !important;
    color: var(--text-muted) !important;
    font-size: 0.9rem !important;
}

/* FullCalendar Elegance */
#calendar {
    background: #ffffff;
    padding: 20px;
    border-radius: var(--border-radius);
}

.fc-header-toolbar {
    margin-bottom: 25px !important;
}

.fc-button {
    background: #ffffff !important;
    border: 1px solid #dfe6e9 !important;
    box-shadow: none !important;
    color: var(--text-main) !important;
    text-transform: capitalize !important;
    font-weight: 500 !important;
    padding: 8px 16px !important;
    height: auto !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}

.fc-button:hover {
    background: var(--light-bg) !important;
    border-color: #b2bec3 !important;
}

.fc-state-active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

.fc-today-button {
    font-weight: 600 !important;
    color: var(--accent) !important;
}

.fc-view-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f1f1f1;
}

.fc-head-container {
    background: #f8f9fa;
    border: none !important;
}

.fc-head th {
    padding: 12px 0 !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-color: #f1f1f1 !important;
}

.fc-day-number {
    padding: 8px 12px !important;
    font-weight: 500;
    color: var(--text-muted);
}

.fc-event {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    cursor: pointer;
}

.fc-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 10 !important;
}

.fc-content {
    padding: 2px 4px;
}

.fc-title {
    font-weight: 500 !important;
}

/* Sidebar Logo refinements */
.logo-mini {
    color: var(--primary) !important;
    font-size: 20px !important;
    font-weight: 800 !important;
}

.logo-lg {
    text-align: left !important;
    line-height: 1.2 !important;
}

.logo-lg b {
    color: var(--accent) !important;
    font-weight: 800 !important;
}

/* Status Indicators Compact */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-active {
    background: #ecfdf5;
    color: #059669;
}

.status-active .status-dot {
    background: #10b981;
}

.status-inactive {
    background: #fef2f2;
    color: #dc2626;
}

.status-inactive .status-dot {
    background: #ef4444;
}

/* Standardized Actions Dropdown */
.btn-action-dt {
    border: 1px solid #f1f5f9 !important;
    background: #fff !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.btn-action-dt:hover,
.btn-action-dt:focus {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
    outline: none !important;
}

.btn-action-dt i {
    font-size: 10px;
    margin-left: 8px;
    opacity: 0.7;
}

.dropdown-menu-actions {
    border-radius: 12px !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    padding: 8px !important;
    min-width: 170px !important;
    margin-top: 5px !important;
    z-index: 1050;
}

.dropdown-menu-actions li a {
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
}

.dropdown-menu-actions li a i {
    width: 24px !important;
    font-size: 14px !important;
    margin-right: 8px !important;
    opacity: 0.7;
    text-align: center;
}

.dropdown-menu-actions li a:hover {
    background: #f1f5f9 !important;
    color: var(--primary) !important;
}

.dropdown-menu-actions li a:hover i {
    opacity: 1;
}

.dropdown-menu-actions .divider {
    margin: 6px 0 !important;
    background-color: #f1f5f9 !important;
}

.dropdown-menu-actions li a.text-danger:hover {
    background: #fff1f2 !important;
    color: #ef4444 !important;
}

/* DataTables Global Header Fixes */
table.dataTable thead th {
    position: relative !important;
    padding-right: 30px !important;
    /* Space for the sorting icon */
    background: #f8fafc !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.05em !important;
    font-weight: 700 !important;
    color: #475569 !important;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

/* DataTables Sorting Icon Alignment */
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 12px !important;
    display: block !important;
    font-family: 'FontAwesome' !important;
    opacity: 0.3 !important;
    font-size: 12px !important;
    color: #475569 !important;
}

table.dataTable thead .sorting_asc:after {
    content: "\f0de" !important;
    /* sort-up */
    opacity: 1 !important;
    color: var(--primary) !important;
}

table.dataTable thead .sorting_desc:after {
    content: "\f0dd" !important;
    /* sort-down */
    opacity: 1 !important;
    color: var(--primary) !important;
}

/* Remove default DataTables sorting images if any */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none !important;
}

/*===================================================================
   FULLCALENDAR V3 MODERN REDESIGN (BASED ON MOCKUP)
===================================================================*/

#calendar {
    margin: 0 auto;
    font-family: 'Inter', sans-serif !important;
    color: #0f172a;
}

/* Toolbar Layout */
.fc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px !important;
    padding: 10px 0;
}

.fc-toolbar .fc-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    order: 1;
}

.fc-toolbar .fc-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    order: 2;
}

.fc-toolbar .fc-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    order: 3;
}


/* Center Title */
.fc-toolbar h2 {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 15px !important;
    text-transform: capitalize;
}

/* Generic Button Reset */
.fc-button {
    background: #f8fafc !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 8px 16px !important;
    height: auto !important;
    transition: all 0.2s ease !important;
    text-transform: capitalize;
}

.fc-button:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Grouped View Buttons */
.fc-button-group {
    background: #f8fafc;
    border-radius: 20px;
    padding: 4px;
    border: 1px solid #f1f5f9;
}

.fc-button-group .fc-button {
    border: none !important;
    background: transparent !important;
    border-radius: 16px !important;
    margin: 0 !important;
}

.fc-button-group .fc-button.fc-state-active {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
}

/* Arrows */
.fc-prev-button,
.fc-next-button {
    background: transparent !important;
    border: none !important;
    color: #0f172a !important;
    padding: 5px 10px !important;
}

.fc-prev-button:hover,
.fc-next-button:hover {
    background: #f1f5f9 !important;
    border-radius: 50% !important;
}

/* Today Button */
.fc-today-button {
    background: #ccfbf1 !important;
    color: #0f766e !important;
    border-radius: 20px !important;
    border: none !important;
    padding: 8px 20px !important;
}

/* Grid Aesthetics */
.fc-head .fc-widget-header {
    border: none !important;
    border-bottom: 2px solid #f8fafc !important;
    padding: 15px 0 !important;
    background: #ffffff !important;
    color: #64748b !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
}

.fc-view-container *,
.fc-view-container *:before,
.fc-view-container *:after {
    border-color: #f1f5f9 !important;
}

.fc-day:hover {
    background: #f8fafc !important;
    cursor: pointer;
}

/* Day Numbers top left */
.fc-day-number {
    float: left !important;
    margin: 8px !important;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

/* Highlight Today */
.fc-state-highlight {
    background: #fffffc !important;
}

.fc-today .fc-day-number {
    color: #06b6d4 !important;
    background: #ccfbf1;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px !important;
}

/* Custom Events */
.fc-event {
    border: none !important;
    padding: 4px 8px !important;
    margin-bottom: 3px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    position: relative;
    padding-left: 18px !important;
    box-shadow: none !important;
    cursor: pointer;
}

.fc-event::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Status Colors */
.fc-status-pending {
    background-color: #f1f5f9 !important;
    /* Gris */
    color: #475569 !important;
}

.fc-status-pending::before {
    background-color: #94a3b8 !important;
}

.fc-status-confirmed {
    background-color: #dcfce7 !important;
    /* Verde */
    color: #166534 !important;
}

.fc-status-confirmed::before {
    background-color: #22c55e !important;
}

.fc-status-cancelled {
    background-color: #fee2e2 !important;
    /* Rojo */
    color: #991b1b !important;
}

.fc-status-cancelled::before {
    background-color: #ef4444 !important;
}

.fc-month-view .fc-time {
    display: none !important;
}

.fc-title {
    font-weight: 600 !important;
}

/*===================================================================
   RIGHT-SIDE OFFCANVAS DAY SUMMARY PANEL
===================================================================*/
.day-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

.day-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile filter bar above calendar */
.fc-mobile-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
}
.fc-mobile-filter i {
    color: #64748b;
    font-size: 16px;
    flex-shrink: 0;
}
.fc-mobile-filter .form-control {
    border: none !important;
    box-shadow: none !important;
    font-weight: 600;
    color: #334155;
    padding: 0 !important;
    height: 32px !important;
}

.day-sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 450px;
    max-width: 100%;
    background: #ffffff;
    z-index: 9999;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.day-sidebar-panel.active {
    transform: translateX(0);
}

.day-sidebar-header {
    padding: 25px 30px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.day-sidebar-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    text-transform: capitalize;
}

.day-sidebar-close {
    background: #f1f5f9;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.day-sidebar-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* HIDE FULLCALENDAR SCHEDULER WATERMARK */
.fc-license-message {
    display: none !important;
}

/* CUSTOM MONTH VIEW SUMMARY OVERRIDE */
/* .fc-month-view .fc-content-skeleton tbody {
    display: none !important;
    Hides original event blocks and '+x more' links exclusively in month mode
} */

.fc-month-view .fc-day-grid-container {
    height: auto !important;
    /* Prevents overflow scrolling bugs when native events are hidden */
}

/*===================================================================
   PREMIUM DESIGN SYSTEM COMPONENTS
===================================================================*/
.premium-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    display: block;
    text-align: left;
}

.premium-input {
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    height: 42px;
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.premium-input:focus {
    border-color: #2dd4bf;
    outline: none;
}

.premium-section-title {
    font-size: 11px;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-section-title i {
    color: #2dd4bf;
    font-size: 14px;
}

.premium-box {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.row-flex {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.col-flex {
    flex: 1;
    min-width: 0;
}

.btn-premium-cancel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 700;
    border-radius: 8px;
    padding: 10px 24px;
    transition: all 0.2s;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-premium-cancel:hover {
    background: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
}

.btn-premium-save {
    background: #2dd4bf;
    border: none;
    color: #ffffff;
    font-weight: 800;
    border-radius: 8px;
    padding: 10px 24px;
    box-shadow: 0 4px 6px -1px rgba(45, 212, 191, 0.3);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    cursor: pointer;
}

.btn-premium-save:hover {
    background: #14b8a6;
    box-shadow: 0 6px 8px -1px rgba(20, 184, 166, 0.4);
    transform: translateY(-1px);
    color: #fff;
}

.fake-addon-input {
    position: relative;
}

.fake-addon-input>i {
    position: absolute;
    left: 15px;
    top: 13px;
    color: #94a3b8;
    z-index: 10;
    pointer-events: none;
}

.fake-addon-input>input,
.fake-addon-input>select {
    padding-left: 40px !important;
}

/* Custom Switch for Premium Design */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #2dd4bf;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/*===================================================================
   RESPONSIVE OVERRIDES & MOBILE OPTIMIZATIONS
===================================================================*/

@media (max-width: 767px) {
    .main-header {
        max-height: 60px !important;
        height: 60px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        background: #111827 !important;
        /* Premium Dark Background */
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .main-header .logo {
        width: auto !important;
        max-width: 120px !important;
        flex: 0 0 auto !important;
        background: transparent !important;
        padding: 0 15px !important;
        display: flex !important;
        align-items: center !important;
        height: 60px !important;
        order: 3 !important;
        /* Logo on the right */
    }

    .main-header .logo .logo-lg {
        display: none !important;
    }

    .main-header .logo .logo-mini {
        display: block !important;
        font-size: 18px !important;
        color: #ffffff !important;
        font-weight: 800 !important;
    }

    .main-header .navbar {
        flex: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 60px !important;
        height: 60px !important;
        background: transparent !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        order: 1 !important;
    }

    .sidebar-toggle {
        margin: 0 !important;
        padding: 20px 15px !important;
        color: #ffffff !important;
        background: transparent !important;
        order: 1 !important;
    }

    .sidebar-toggle:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
    }

    .navbar-custom-menu {
        display: flex !important;
        align-items: center !important;
    }

    .navbar-center {
        display: none !important;
        /* Hide title on mobile to prevent overflow */
    }

    .navbar-right-section {
        flex: 0 0 auto !important;
        padding-right: 0 !important;
    }

    .navbar-left {
        flex: 1 !important;
    }

    /* Adjust notifications and user icons for mobile */
    .navbar-nav>li>a {
        padding: 20px 10px !important;
        color: #ffffff !important;
    }

    .navbar-nav>li .label {
        top: 12px !important;
        right: 5px !important;
    }

    .content-wrapper {
        margin-left: 0 !important;
        padding: 75px 10px 10px 10px !important;
        /* Space for fixed header */
    }

    .p-20 {
        padding: 10px 5px !important;
    }

    /* Force flex rows to wrap on mobile */
    .row-flex {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .col-flex {
        width: 100% !important;
    }

    /* Adjust Login Card for small screens */
    .login-box,
    .login-card {
        width: 95% !important;
        max-width: 380px !important;
        padding: 30px 20px !important;
        margin: 10px auto !important;
    }

    /* Stats boxes adjustment */
    .info-box {
        margin-bottom: 15px;
    }

    /* Sidebar toggle button visibility */
    .sidebar-toggle {
        padding: 20px 15px !important;
    }

    /* Navbar items spacing */
    .navbar-custom-menu .navbar-nav>li>a {
        padding: 20px 10px !important;
    }

    /* Fix for some fixed layouts */
    .fixed .content-wrapper,
    .fixed .main-sidebar {
        padding-top: 60px !important;
    }

    /* Calendar mobile adjustments */
    #calendar {
        padding: 10px !important;
    }

    .fc-toolbar {
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .fc-toolbar .fc-left,
    .fc-toolbar .fc-center,
    .fc-toolbar .fc-right {
        flex: none !important;
    }

    .fc-toolbar .fc-center {
        order: 1 !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .fc-toolbar .fc-left {
        order: 2 !important;
    }

    .fc-toolbar .fc-right {
        order: 3 !important;
        margin-left: auto !important;
    }

    .fc-toolbar h2 {
        font-size: 15px !important;
        margin: 0 8px !important;
    }

    .fc-button {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    /* Day sidebar full-width on mobile */
    .day-sidebar-panel {
        width: 100% !important;
    }

    .day-sidebar-header {
        padding: 18px 20px !important;
    }

    .day-sidebar-content {
        padding: 15px !important;
    }

    /* Legend wrap on mobile */
    .fc-legend {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    /* Modal body padding on mobile */
    .modal-body {
        padding: 15px !important;
    }

    .modal-header {
        padding: 15px 20px !important;
    }
}

/* Tablet and smaller */
@media (max-width: 991px) {
    .nav-search-container {
        display: none !important;
        /* Hide search bar on tablets to save space */
    }
}

/* Utility for responsive tables */
.table-responsive {
    border: none !important;
    margin-bottom: 0;
}

/* Fix for Select2 on mobile */
@media (max-width: 767px) {
    .select2-container {
        width: 100% !important;
    }

    /* Reduce height of upcoming sessions sidebar on mobile */
    .upcoming-scroll-container {
        height: 300px !important;
        max-height: 50vh !important;
    }

    /* Ensure form-horizontal labels stack properly on mobile */
    .form-horizontal .control-label {
        text-align: left !important;
        padding-top: 0 !important;
        margin-bottom: 5px !important;
    }

    /* Make action button icon only on mobile (no extra margin) */
    .btn-primary-modern .fa-plus {
        margin-right: 0 !important;
    }
}

/*===================================================================
   PASO 4: TOKENS, ACCESIBILIDAD Y MOVIL
===================================================================*/
:root {
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #16a34a;
    --warning: #d97706;
    --text-subtle: #64748b; /* contraste AA sobre blanco (reemplaza #94a3b8) */
    --focus-ring: 0 0 0 3px rgba(14, 165, 233, 0.45);
}

/* Foco visible para teclado en todo el sitio */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

/* Botones de accion en tablas (icono) */
.btn-danger-soft {
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
}

.btn-danger-soft:hover,
.btn-danger-soft:focus {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Estado vacio de tablas */
.dataTables_empty {
    text-align: center !important;
    padding: 40px 15px !important;
    color: var(--text-subtle) !important;
    font-weight: 600;
}

/* Tarjetas de evento del calendario como enlaces */
a.day-event-card {
    display: block;
    text-decoration: none !important;
    color: inherit;
}

/* Barra de acciones fija en formularios largos */
.form-actions-sticky {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    padding-bottom: 12px !important;
    z-index: 5;
}

@media (max-width: 767px) {
    /* Objetivos tactiles de al menos 44px */
    .btn,
    .btn-premium-save,
    .btn-premium-cancel,
    .btn-action-dt,
    .form-control,
    .premium-input {
        min-height: 44px;
    }

    .btn-xs {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 13px;
    }

    .btn-icon-sm {
        width: 40px;
        height: 40px;
    }

    .dropdown-menu-actions > li > a {
        padding: 12px 16px !important;
    }

    /* Tablas: desplazamiento horizontal en vez de desbordar la pagina */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .flash-toast {
        min-width: 0;
    }
}

/* Auditoria y paginacion (clases compartidas) */
.card-filter { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; }
.text-muted-nowrap { white-space: nowrap; color: var(--text-subtle); }
.text-muted-sm { font-size: 11px; color: var(--text-subtle); }
.fw-600 { font-weight: 600; }
.audit-detail { max-width: 460px; font-size: 12px; vertical-align: top !important; }
.audit-detail summary { cursor: pointer; color: var(--primary); font-weight: 600; outline: none; }
.audit-detail details[open] summary { margin-bottom: 8px; }
/* Detalle en cuadricula compacta: campo | valor */
.audit-kv { display: grid; grid-template-columns: max-content 1fr; gap: 0; width: 100%; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.audit-k, .audit-v { padding: 5px 10px; line-height: 1.35; border-bottom: 1px solid #eef2f7; }
.audit-k { color: var(--text-subtle); font-weight: 600; white-space: nowrap; background: #f1f5f9; }
.audit-v { word-break: break-word; color: #1e293b; }
.audit-kv > :nth-last-child(-n+2) { border-bottom: 0; }
.audit-old { color: #b91c1c; text-decoration: line-through; }
.audit-new { color: #166534; font-weight: 600; }
.pager-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.pager-info { color: var(--text-subtle); font-size: 13px; margin-top: 15px; }
.empty-state { background: #fff; border: 1px dashed #cbd5e1; color: var(--text-subtle); text-align: center; border-radius: 16px; padding: 40px; }
.empty-state > i { font-size: 48px; margin-bottom: 15px; display: block; opacity: 0.3; }

/*===================================================================
   FORMULARIO DE CITAS (compartido: nueva / copiar / editar)
===================================================================*/
.form-hero { background: #ffffff; border-radius: 16px; padding: 25px 35px; margin-bottom: 25px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; }
.form-hero-main { display: flex; align-items: center; gap: 15px; }
.form-hero-icon { background: #e0e7ff; color: #4338ca; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.form-hero-title { font-size: 18px; font-weight: 800; color: #0f172a; margin: 0 0 4px 0; }
.form-hero-sub { margin: 0; font-size: 13px; color: var(--text-subtle); font-weight: 500; }
.form-body { background: #f8fafc; border-radius: 16px; padding: 35px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.btn-ghost-action { background: #ffffff; border: 1px solid #cbd5e1; color: #0369a1; font-weight: 700; border-radius: 8px; padding: 8px 16px; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost-action:hover { background: #f0f9ff; }

/* Grupo con icono (select / texto fijo) */
.ig-modern { display: flex; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.02); border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; background: #ffffff; width: 100%; }
.ig-modern.is-readonly { background: #f8fafc; }
.ig-addon { color: var(--text-subtle); padding: 6px 15px; border-right: 1px solid #f1f5f9; flex: 0 0 auto; }
.ig-control { flex: 1; min-width: 0; border: none !important; background: transparent !important; height: 44px; font-weight: 600; color: #334155; box-shadow: none !important; cursor: pointer; }
.ig-modern.is-readonly .ig-control { cursor: not-allowed; color: #475569; display: flex; align-items: center; }

.premium-section-title.spaced { margin-top: 25px; }
.spaced { margin-top: 25px; }
.date-time-pair { display: flex; gap: 10px; }
.status-box { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 15px; min-height: 42px; font-size: 13px; color: #475569; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-box b { color: #1e293b; }
.switch-row { display: flex; align-items: center; gap: 15px; padding-bottom: 10px; }
.switch-row .switch { margin-bottom: 0; }
.switch-text { font-size: 13px; font-weight: 700; color: #0369a1; }
.notes-block { margin-bottom: 30px; }
.textarea-sm { height: 80px; resize: none; }
.form-actions-bar { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; border-top: 1px solid #e2e8f0; margin-top: 20px; }
.btn-block-save { width: 100%; }
.premium-box .row-flex { margin-bottom: 20px; }

/* Finanzas */
.finance-strip { background: #f8fafc; border-radius: 8px; padding: 20px; display: flex; gap: 30px; flex-wrap: wrap; }
.money-field { flex: 1; min-width: 120px; }
.money-label { font-size: 11px; text-transform: uppercase; color: var(--text-subtle); font-weight: 800; margin-bottom: 4px; display: block; }
.money-wrap { position: relative; }
.money-sign { position: absolute; left: 0; top: 10px; color: #1e293b; font-weight: 800; }
.money-input { border: none; border-bottom: 1px solid #cbd5e1; width: 100%; border-radius: 0; padding: 10px 0 10px 15px; background: transparent; font-weight: 800; color: #0f172a; font-size: 16px; outline: none; box-shadow: none; }
.money-input:focus { border-bottom-color: var(--primary); }
.money-field.danger .money-label, .money-field.danger .money-sign, .money-field.danger .money-input { color: #b91c1c; }
.money-field.danger .money-input { border-bottom-color: #fecaca; }
.money-field.success .money-label, .money-field.success .money-sign, .money-field.success .money-input { color: #0f766e; }
.money-field.success .money-input { border-bottom-color: #ccfbf1; }

@media (max-width: 767px) {
    .form-body { padding: 18px; }
    .form-hero { padding: 18px; }
    .finance-strip { gap: 18px; }
    .date-time-pair { flex-direction: column; }
}

/* ===== Movil: ajustes de zoom iOS, anchos fijos y botones (auditoria UX) ===== */
@media (max-width: 767px) {
    .form-control, .premium-input, .pickadate, .pickadate2,
    .dataTables_filter input, .dataTables_length select, .select2-search__field,
    input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
    input[type="date"], input[type="time"], input[type="password"], select, textarea {
        font-size: 16px !important;
    }
    .col-flex, .u-502951 { min-width: 0 !important; flex: 1 1 100% !important; }
    .schedule-label { width: 100% !important; }
    input[type="time"].premium-input { width: 100% !important; min-width: 0 !important; }
    [style*="width: 250px"], [style*="width: 220px"] { width: 100% !important; max-width: 100% !important; }
    .btn-premium-save { width: 100% !important; min-width: 0 !important; }
    .btn-premium-save[style*="min-width"] { min-width: 0 !important; }
}

/* ===== Calendario movil: vista mensual compacta (solo contador por dia) ===== */
@media (max-width: 767px) {
    .fc-mobile-filter { width: 100%; box-sizing: border-box; }
    .fc-mobile-filter .form-control { flex: 1 1 auto; width: 100% !important; min-width: 0 !important; max-width: 100%; }
    .fc-basic-view .fc-day-grid .fc-event-container { display: none !important; }
    .fc-basic-view .fc-day-grid .fc-row { min-height: 52px; }
    .fc-basic-view .fc-day-top .fc-day-number { float: none !important; display: block; text-align: center; padding: 4px 0 0 !important; }
    .fc-basic-view .fc-day-top .custom-atenciones {
        margin: 2px 4px 4px !important; padding: 3px 0 !important; font-size: 12px !important; line-height: 1.2;
        border-radius: 999px !important; min-height: 22px;
    }
    .fc-toolbar { flex-wrap: wrap; gap: 8px; }
    .fc-toolbar h2 { font-size: 16px; }
}

/* ===== Movil: buscador dentro del contenido ===== */
.nav-search-container.search-in-content { display: block !important; padding: 12px 15px 0; }
.nav-search-container.search-in-content > div { width: 100% !important; }

/* ===== Movil: tablas como tarjetas (.table-cards + td[data-label]) ===== */
@media (max-width: 767px) {
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards thead { display: none; }
    .table-cards tr { padding: 12px 14px; border-bottom: 8px solid #f1f5f9; position: relative; }
    .table-cards td { border: none !important; padding: 5px 0 !important; text-align: left !important; }
    .table-cards td[data-label]::before {
        content: attr(data-label); display: block; font-size: 11px; font-weight: 800;
        text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; margin-bottom: 2px;
    }
    .table-cards td[data-label="Nombre"]::before, .table-cards td[data-label="Ficha"]::before,
    .table-cards td[data-label="Acciones"]::before { display: none; }
    .table-cards td[data-label="Ficha"] { position: absolute; top: 12px; right: 14px; width: auto; }
    .table-cards td[data-label="Nombre"] { padding-right: 48px !important; }
    .table-cards td[data-label="Acciones"] { padding-top: 10px !important; }
    .table-cards td[data-label="Acciones"] .btn-action-dt { width: 100%; min-height: 44px; }
    .table-cards td[data-label="Acciones"] .dropdown { display: block; }
    .table-cards .table-responsive, .table-responsive:has(.table-cards) { overflow-x: visible; border: 0; }
}

/* Aviso de choques de horario */
.conflict-alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 20px; font-weight: 600; font-size: 13px; display: none; }
.conflict-alert.is-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.conflict-alert.is-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Disponibilidad */
.av-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 15px; }
.av-title { margin: 0 0 2px; font-weight: 800; color: #0f172a; }
.av-sub { margin: 0; color: var(--text-subtle); font-size: 13px; }
.av-day { display: flex; gap: 20px; align-items: flex-start; background: #ffffff; border: 1px solid #f1f5f9; border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.av-day-label { flex: 0 0 170px; }
.av-day-name { font-weight: 800; color: #0f172a; }
.av-slots { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.av-slot { display: inline-block; background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 13px; text-decoration: none; }
.av-slot:hover, .av-slot:focus { background: #0ea5e9; color: #ffffff; border-color: #0ea5e9; text-decoration: none; }
.av-slot-inline { margin: 2px 6px 2px 0; padding: 4px 10px; }
.av-full { color: #991b1b; font-weight: 700; font-size: 13px; }
@media (max-width: 767px) { .av-day { flex-direction: column; gap: 10px; } .av-day-label { flex: none; } }

/* Portal del paciente: tarjetas de citas */
.section-h { font-size: 16px; font-weight: 800; color: #0f172a; margin: 25px 0 12px; }
.appt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.appt-card { display: flex; gap: 16px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; box-shadow: 0 2px 4px rgba(0,0,0,0.03); }
.appt-date { flex: 0 0 62px; height: 66px; border-radius: 12px; background: #e0f2fe; color: #0369a1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.appt-day { font-size: 24px; font-weight: 800; line-height: 1; }
.appt-mon { font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.appt-body { flex: 1; min-width: 0; }
.appt-title { font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.appt-meta { color: var(--text-subtle); font-size: 13px; margin-bottom: 8px; }
.appt-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Evolucion clinica */
.clin-summary { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; }
.note-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 2px 4px rgba(0,0,0,0.03); }
.note-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.note-title { margin-left: 8px; color: #0f172a; }
.note-body { color: #1e293b; line-height: 1.6; word-break: break-word; }
.note-foot { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f1f5f9; }
.note-versions summary { cursor: pointer; color: var(--primary); font-size: 12px; font-weight: 700; }
.note-version { margin-top: 8px; padding: 8px 12px; background: #f8fafc; border-radius: 8px; }
.note-version-body { font-size: 12px; color: #475569; margin-top: 4px; }
.note-actions { display: flex; gap: 6px; }

/* Editor de notas (barra de herramientas) */
.rte { border: 1px solid #cbd5e1; border-radius: 10px; background: #ffffff; overflow: hidden; }
.rte:focus-within { border-color: var(--primary); box-shadow: var(--focus-ring); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px 8px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.rte-toolbar button { width: 34px; height: 32px; border: 0; background: transparent; border-radius: 6px; color: #334155; cursor: pointer; }
.rte-toolbar button:hover { background: #e2e8f0; }
.rte-toolbar button.is-active { background: #dbeafe; color: #1d4ed8; }
.rte-sep { width: 1px; height: 20px; background: #cbd5e1; margin: 0 6px; }
.rte-area { min-height: 220px; max-height: 60vh; overflow-y: auto; padding: 14px 16px; line-height: 1.6; color: #1e293b; outline: none; word-break: break-word; }
.rte-area:empty:before { content: attr(data-placeholder); color: #94a3b8; pointer-events: none; }
.rte-area h4, .note-body h4 { font-size: 15px; font-weight: 800; margin: 10px 0 4px; }
.rte-area ul, .rte-area ol, .note-body ul, .note-body ol { padding-left: 22px; margin: 4px 0; }
.rte-area p, .note-body p { margin: 0 0 6px; }
.rte-area blockquote, .note-body blockquote { border-left: 3px solid #cbd5e1; padding-left: 10px; color: #475569; }

/* Informe con IA */
.ai-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: transparent; border: 0; padding: 0; font-weight: 800; color: #0f172a; font-size: 15px; cursor: pointer; }
.ai-toggle .fa-magic { color: #7c3aed; margin-right: 6px; }
.ai-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 4px; }
.ai-checks label { font-weight: 600; font-size: 13px; color: #334155; margin: 0; }
.ai-preview { margin-top: 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; font-size: 13px; }
.ai-preview pre { white-space: pre-wrap; max-height: 320px; overflow: auto; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; font-size: 12px; }

/* Cobros, indicadores y objetivos */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #ffffff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15,23,42,.08); border-left: 4px solid #cbd5e1; display: flex; flex-direction: column; }
.kpi span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.kpi strong { font-size: 24px; color: #0f172a; line-height: 1.2; }
.kpi small { color: #64748b; font-size: 12px; }
.kpi-ok { border-left-color: #10b981; } .kpi-warn { border-left-color: #f59e0b; } .kpi-bad { border-left-color: #ef4444; }
.bill-card .box-body { padding: 16px 18px; }
.bill-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.bill-amount { font-size: 22px; font-weight: 800; color: #b45309; white-space: nowrap; }
.bill-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; }
.goal-card .box-body { padding: 16px 18px; }
.goal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.goal-level { text-align: right; font-size: 13px; color: #64748b; min-width: 110px; } .goal-level strong { font-size: 26px; color: #0f172a; }
.goal-bar { height: 8px; background: #e2e8f0; border-radius: 6px; overflow: hidden; margin-top: 8px; } .goal-bar span { display: block; height: 100%; background: linear-gradient(90deg, #2dd4bf, #0d9488); border-radius: 6px; }
.goal-history { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; } .goal-history li { padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.goal-progress-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; } .goal-progress-form .form-control { width: auto; }
.ind-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; } .ind-name { flex: 1.3; font-weight: 600; min-width: 0; }
.ind-bar { flex: 2; height: 10px; background: #e2e8f0; border-radius: 6px; overflow: hidden; } .ind-bar span { display: block; height: 100%; background: #2dd4bf; }
.ind-num { width: 40px; text-align: right; font-weight: 800; }
@media (max-width: 767px) { .goal-head, .bill-head { flex-direction: column; align-items: flex-start; } .goal-level { text-align: left; } .goal-progress-form .form-control { width: 100%; } }

/* Select2 (combobox): misma altura, borde y radio que los campos de texto (.form-control) */
.select2-container--default .select2-selection--single {
    height: 45px !important;
    border: 1px solid #dcdde1 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
    padding: 0 34px 0 15px !important;
    color: #1e293b !important;
    font-size: 14px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #94a3b8 !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 43px !important; top: 0 !important; right: 8px !important; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--accent, #2dd4bf) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15) !important;
}
.select2-container--default.select2-container--disabled .select2-selection--single { background: #f1f5f9 !important; }
.select2-dropdown { border: 1px solid #dcdde1 !important; border-radius: 8px !important; box-shadow: 0 10px 25px -5px rgba(15,23,42,.15); overflow: hidden; z-index: 10050; }
.select2-search--dropdown .select2-search__field { border: 1px solid #dcdde1 !important; border-radius: 6px !important; height: 36px; padding: 4px 10px; }
.select2-container--default .select2-results__option { padding: 8px 14px; font-size: 14px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: #0d9488 !important; }
/* dentro de filas flex (formularios en linea) el combobox no debe estirarse a todo el ancho */
.goal-progress-form .select2-container, .bill-actions .select2-container { width: auto !important; min-width: 240px; }
/* campo de archivo */
input[type="file"].form-control { padding: 9px 12px !important; height: auto !important; min-height: 45px; line-height: 1.4; }
input[type="file"].form-control::file-selector-button { border: 1px solid #cbd5e1; background: #f1f5f9; border-radius: 6px; padding: 6px 12px; margin-right: 10px; font-weight: 600; color: #334155; cursor: pointer; }
input[type="file"].form-control::file-selector-button:hover { background: #e2e8f0; }
/* selector "mostrar N registros" de las tablas: mas compacto */
.dataTables_length .select2-container--default .select2-selection--single { height: 36px !important; }
.dataTables_length .select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px !important; }
.dataTables_length .select2-container { width: auto !important; min-width: 80px; }

/* =====================================================================
   Sistema de diseño: tokens, tipografía y componentes compartidos
   ===================================================================== */
:root {
    --brand: #0d9488;            /* verde del centro (contraste AA con texto blanco) */
    --brand-dark: #0f766e;
    --brand-soft: #ccfbf1;
    --text-strong: #0f172a;
    --text-body: #334155;
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-md: 14px;
    --fs-lg: 16px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --st-pending-bg: #fef3c7; --st-pending-fg: #92400e;
    --st-ok-bg: #dcfce7;      --st-ok-fg: #166534;
    --st-done-bg: #dbeafe;    --st-done-fg: #1e40af;
    --st-noshow-bg: #fee2e2;  --st-noshow-fg: #991b1b;
    --st-cancel-bg: #f1f5f9;  --st-cancel-fg: #475569;
    --st-paid-bg: #ede9fe;    --st-paid-fg: #5b21b6;
}
body { font-size: var(--fs-md); color: var(--text-body); }
h1, h2, h3, h4, .box-title, .section-h { color: var(--text-strong); }

/* Etiquetas y textos pequeños: mas grandes y con mejor contraste (antes 11px) */
.premium-label { font-size: var(--fs-sm) !important; color: var(--text-body) !important; font-weight: 700 !important; }
.text-muted-sm { font-size: var(--fs-xs); }
.table thead th, table.dataTable thead th { font-size: var(--fs-xs) !important; color: #475569 !important; }
.kpi span, .money-label, .premium-section-title { font-size: var(--fs-xs) !important; }
.info-box-text { font-size: var(--fs-xs) !important; }
.table > tbody > tr > td { font-size: var(--fs-md); }

/* Botones principales con la marca (el verde claro anterior no tenia contraste con el texto blanco) */
.btn-premium-save, .btn-primary-modern, a.btn-premium-save {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #ffffff !important;
}
.btn-premium-save:hover, .btn-primary-modern:hover { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; }

/* Chips de estado (mismos colores en todas las pantallas) */
.st-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; line-height: 1.5; white-space: nowrap; }
.st-pending { background: var(--st-pending-bg); color: var(--st-pending-fg); }
.st-ok { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.st-done { background: var(--st-done-bg); color: var(--st-done-fg); }
.st-noshow { background: var(--st-noshow-bg); color: var(--st-noshow-fg); }
.st-cancel { background: var(--st-cancel-bg); color: var(--st-cancel-fg); }
.st-paid { background: var(--st-paid-bg); color: var(--st-paid-fg); }

/* Inicio: saludo, agenda del dia y avisos */
.home-hero { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.home-greet { margin: 0; font-size: 26px; font-weight: 800; color: var(--text-strong); }
.home-date { color: var(--text-subtle); font-size: var(--fs-lg); margin-top: 2px; }
.day-nav { display: flex; gap: 6px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; margin-bottom: 8px; }
.home-grid .box { margin-bottom: 18px !important; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; grid-template-areas: "time main status" "time actions actions"; gap: 4px 14px; padding: 14px 18px; border-bottom: 1px solid #f1f5f9; align-items: center; }
.agenda-row:last-child { border-bottom: 0; }
.agenda-row:hover { background: #f8fafc; }
.agenda-row.is-cancelled { opacity: .55; }
.agenda-time { grid-area: time; font-size: 18px; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.agenda-main { grid-area: main; min-width: 0; }
.agenda-patient { font-weight: 700; color: var(--text-strong); font-size: var(--fs-lg); }
.agenda-patient:hover { color: var(--brand); text-decoration: none; }
.agenda-sub { color: var(--text-subtle); font-size: var(--fs-sm); }
.agenda-status { grid-area: status; display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.agenda-rem { color: var(--text-subtle); }
.agenda-actions { grid-area: actions; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.attn-list { list-style: none; margin: 0; padding: 4px 0; }
.attn { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: var(--text-body); border-left: 4px solid transparent; }
.attn:hover { background: #f8fafc; text-decoration: none; color: var(--text-strong); }
.attn > .fa:first-child { font-size: 18px; width: 22px; text-align: center; }
.attn span { flex: 1; min-width: 0; } .attn strong { display: block; font-size: var(--fs-md); color: var(--text-strong); } .attn small { color: var(--text-subtle); font-size: var(--fs-xs); }
.attn-go { color: #cbd5e1; font-size: 11px; }
.attn-warn { border-left-color: #f59e0b; } .attn-warn > .fa:first-child { color: #d97706; }
.attn-bad { border-left-color: #ef4444; } .attn-bad > .fa:first-child { color: #dc2626; }
.attn-info { border-left-color: #0ea5e9; } .attn-info > .fa:first-child { color: #0284c7; }
.home-quick { display: grid; gap: 8px; }
.home-quick .btn { text-align: left; }
@media (max-width: 991px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575px) {
    .home-greet { font-size: 22px; }
    .agenda-row { grid-template-columns: 50px minmax(0, 1fr); grid-template-areas: "time main" "time status" "actions actions"; }
    .agenda-status { justify-content: flex-start; }
}
.box > .box-header > .box-title, .box-header .box-title { font-size: var(--fs-lg) !important; font-weight: 800 !important; color: var(--text-strong) !important; text-transform: none !important; letter-spacing: 0 !important; }
.home-grid .box-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Ficha del paciente: cabecera, pestañas y resumen */
.pf-head { background: #ffffff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); margin-bottom: 18px; overflow: hidden; }
.pf-top { display: flex; gap: 16px; align-items: center; padding: 20px 24px 14px; flex-wrap: wrap; }
.pf-avatar { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; flex: 0 0 56px; }
.pf-id { flex: 1; min-width: 220px; }
.pf-name { margin: 0; font-size: 22px; font-weight: 800; color: var(--text-strong); }
.pf-meta { color: var(--text-subtle); font-size: var(--fs-sm); margin-top: 2px; }
.pf-meta .fa { margin-right: 3px; } .pf-dot { margin: 0 8px; }
.pf-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; } .pf-badges a.st-chip:hover { text-decoration: none; filter: brightness(.95); }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-tabs { display: flex; gap: 2px; padding: 0 16px; border-top: 1px solid #f1f5f9; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pf-tab { padding: 12px 14px; color: var(--text-subtle); font-weight: 600; font-size: var(--fs-md); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pf-tab .fa { margin-right: 4px; }
.pf-tab:hover { color: var(--text-strong); text-decoration: none; background: #f8fafc; }
.pf-tab.is-active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.pf-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.pf-grid .box { margin-bottom: 18px !important; }
.pf-grid .box-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-list { list-style: none; margin: 0; padding: 0; }
.pf-list > li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f1f5f9; }
.pf-list > li:last-child { border-bottom: 0; }
.pf-snippet { color: var(--text-body); font-size: var(--fs-sm); margin-top: 4px; }
.pf-empty { padding: 18px; color: var(--text-subtle); font-size: var(--fs-sm); }
.pf-dl { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; font-size: var(--fs-md); }
.pf-dl dt { color: var(--text-subtle); font-weight: 600; font-size: var(--fs-sm); } .pf-dl dd { margin: 0; color: var(--text-strong); word-break: break-word; }
.pf-goal { margin-bottom: 12px; } .pf-goal:last-child { margin-bottom: 0; }
.pf-goal-top { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-md); }
.pf-money { font-size: 26px; font-weight: 800; color: #b45309; }
@media (max-width: 991px) { .pf-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575px) { .pf-top { padding: 16px; } .pf-actions .btn { flex: 1; } .pf-name { font-size: 19px; } }
.box-header .box-title { text-align: left !important; margin: 0; }
.pf-tabs { overflow-y: hidden; }
.home-grid .box-header::before, .home-grid .box-header::after, .pf-grid .box-header::before, .pf-grid .box-header::after { display: none !important; }
.note-session-obs { background: #f8fafc; border: 1px solid #f1f5f9; border-left: 3px solid #0891b2; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #475569; margin-bottom: 10px; }
.note-session-obs .fa { color: #0891b2; margin-right: 4px; }

/* Evolucion clinica: pestañas Notas / Observaciones registradas */
.cn-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e2e8f0; margin-bottom: 16px; }
.cn-tab { background: transparent; border: 0; padding: 10px 16px; font-weight: 700; font-size: var(--fs-md); color: var(--text-subtle); border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.cn-tab:hover { color: var(--text-strong); }
.cn-tab.is-active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.cn-tab-count { display: inline-block; background: #f1f5f9; color: #475569; border-radius: 999px; padding: 1px 8px; font-size: var(--fs-xs); font-weight: 800; margin-left: 4px; }
.cn-tab.is-active .cn-tab-count { background: var(--brand-soft); color: var(--brand-dark); }

/* Evolucion clinica: boton "Nueva nota" en la barra de pestañas, y modal de la nota */
.cn-tabs { position: relative; }
.cn-new-note { margin-left: auto; align-self: center; padding: 6px 14px !important; height: auto !important; }
#noteModal .modal-body { max-height: 75vh; overflow-y: auto; }
#noteModal #ai-panel, #noteModal #note-form { margin-bottom: 16px; }
#noteModal #note-form:last-child { margin-bottom: 0; }

/* Selector de hora/fecha (pickadate): el efecto 3D de apertura (perspective + rotateX) deja el
   contenido invisible en algunos navegadores/GPUs aunque su posicion sea correcta. Se desactiva
   ese efecto (queda solo el fundido de opacidad) sin tocar el plugin de terceros. */
.picker--opened .picker__holder, .picker__holder {
    -webkit-transform: none !important;
    transform: none !important;
}


/* Menu lateral: scroll propio cuando el menu es mas alto que la pantalla.
   Se mide dentro de la altura visible (border-box) para que la barra no quede bajo el borde de la ventana. */
.main-sidebar {
    box-sizing: border-box;
    height: 100vh !important;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.main-sidebar::-webkit-scrollbar { width: 6px; }
.main-sidebar::-webkit-scrollbar-track { background: transparent; }
.main-sidebar::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 6px; }
.main-sidebar:hover::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.5); }
.main-sidebar::-webkit-scrollbar-thumb:hover { background: var(--sidebar-active); }
.main-sidebar .sidebar { padding-bottom: 24px; }
/* Menu colapsado: los submenus se abren hacia el lado al pasar el mouse, no se pueden recortar */
.sidebar-collapse .main-sidebar { overflow: visible; }

/* Agenda del dia: pestanas "Por atender" / "Ya pasaron" */
.agenda-tabs { display: inline-flex; gap: 4px; margin-left: 14px; padding: 3px; background: #f1f5f9; border-radius: 999px; vertical-align: middle; }
.agenda-tab { border: 0; background: transparent; color: var(--secondary); font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.agenda-tab:hover { color: var(--dark); }
.agenda-tab.is-active { background: #fff; color: var(--dark); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.agenda-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #e2e8f0; color: var(--secondary); font-size: 11px; text-align: center; }
.agenda-tab.is-active .agenda-count { background: var(--primary-light); color: #0369a1; }
.agenda-panel[hidden] { display: none; }
.agenda-tab-link { text-decoration: none; display: inline-block; }
.agenda-tab-link:hover { background: #fff; color: var(--dark); text-decoration: none; }

/* Inicio: botones en forma de viñeta (mismo estilo que las pestañas de la agenda) */
.day-nav { gap: 4px; padding: 3px; background: #f1f5f9; border-radius: 999px; align-items: center; }
.day-nav .btn { border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--secondary) !important; font-weight: 600; border-radius: 999px !important; padding: 5px 14px; transition: background .15s, color .15s; }
.day-nav .btn:hover { color: var(--dark) !important; }
.day-nav .btn.btn-primary-modern { background: #fff !important; color: var(--dark) !important; box-shadow: 0 1px 3px rgba(15, 23, 42, .12) !important; }
.day-nav .btn .fa { font-size: 11px; }

.agenda-actions .btn,
.home-quick .btn { border: 1px solid #e2e8f0 !important; background: #f8fafc !important; color: #334155 !important; font-weight: 600; border-radius: 999px !important; padding: 4px 12px; box-shadow: none !important; transition: background .15s, box-shadow .15s, border-color .15s; }
.home-quick .btn { padding: 8px 16px; }
.agenda-actions .btn:hover,
.home-quick .btn:hover { background: #fff !important; border-color: #cbd5e1 !important; box-shadow: 0 1px 3px rgba(15, 23, 42, .12) !important; color: var(--dark) !important; }
.agenda-actions .btn.text-danger { color: #b91c1c !important; }
.agenda-actions .btn.text-danger:hover { background: #fef2f2 !important; border-color: #fecaca !important; }
