* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f9;
    color: #1f2937;
}

.sidebar {
    width: 260px;
    height: 100dvh;
    min-height: 100dvh;
    box-sizing: border-box;

    background: #1f3b57;
    color: white;

    position: fixed;
    left: 0;
    top: 0;

    padding: 28px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.sidebar h2 {
    margin: 0 0 35px;
    font-size: 22px;
}

.sidebar nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 16px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255, 255, 255, 0.15);
}

.main {
    margin-left: 260px;
    padding: 35px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.topbar h1 {
    margin: 0;
    color: #1f3b57;
}

.topbar p {
    margin: 6px 0 0;
    color: #6b7280;
}

.btn-primary {
    background: #1f3b57;
    color: white;
    border: none;
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #2c587f;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

.card span {
    font-size: 30px;
}

.card h3 {
    margin: 15px 0 8px;
    font-size: 16px;
    color: #6b7280;
}

.card p {
    margin: 0;
    font-size: 38px;
    font-weight: bold;
    color: #1f3b57;
}

.panel {
    background: white;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

.panel h2 {
    margin-top: 0;
    color: #1f3b57;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: #6b7280;
    font-weight: 600;
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.badge {
    background: #fff3cd;
    color: #856404;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
}













.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-grid input,
.form-grid textarea {
    width: 100%;
    padding: 13px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    font-family: Arial, sans-serif;
}

.form-grid textarea {
    grid-column: span 2;
    min-height: 100px;
    resize: vertical;
}

.form-grid button {
    width: fit-content;
}







.search-box {
    display: flex;
    gap: 12px;
}

.search-box input {
    flex: 1;
    padding: 13px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
}

.btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
    text-decoration: none;
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 15px;
}














.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.module-card {
    background: #f4f6f9;
    border: 1px solid #e5e7eb;
    padding: 25px;
    border-radius: 14px;
    font-weight: bold;
    color: #1f3b57;
    cursor: pointer;
}

.module-card:hover {
    background: #eaf1f7;
}










.historial-card {
    background: #f9fafb;
    border-left: 5px solid #1f3b57;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.historial-card h3 {
    margin-top: 0;
    color: #1f3b57;
}

.module-card {
    text-decoration: none;
    display: block;
}





.btn-primary {
    text-decoration: none;
    display: inline-block;
}









.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-header button {
    background: transparent;
    border: none;
    font-size: 40px;
    cursor: pointer;
    color: #1f3b57;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.calendar-weekdays span {
    font-weight: bold;
    padding: 15px;
    color: #374151;
}

.calendar-day {
    padding: 18px;
    margin: 5px;
    border-radius: 50%;
    color: #6b7280;
    font-weight: bold;
    cursor: default;
    position: relative;
}

.calendar-day.available {
    background: #35b66b;
    color: white;
    cursor: pointer;
}

.calendar-day.available:hover {
    background: #249653;
    transform: scale(1.08);
}

.calendar-day.empty {
    background: transparent;
}

.hour-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: grid;
    gap: 6px;
}

.hours-panel p {
    color: #6b7280;
}





#dayHours {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 8px;
}

#dayHours::-webkit-scrollbar {
    width: 8px;
}

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

#dayHours::-webkit-scrollbar-track {
    background: #f1f5f9;
}




.badge-danger {
    background: #fee2e2;
    color: #991b1b;
    margin-left: 8px;
}




.tabs-paciente {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tabs-paciente a {
    text-decoration: none;
    background: #f4f6f9;
    color: #1f3b57;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: bold;
}

.tabs-paciente a:hover,
.tabs-paciente .tab-active {
    background: #1f3b57;
    color: white;
}






.suggestions-box {
    display: none;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-top: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    overflow: hidden;
}

.suggestion-item {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: #1f2937;
    border-bottom: 1px solid #f1f5f9;
}

.suggestion-item:hover {
    background: #eef6ff;
}

.suggestion-item strong {
    display: block;
    color: #1f3b57;
}

.suggestion-item span {
    font-size: 13px;
    color: #6b7280;
}





.valor-neto {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}








.finance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.finance-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.finance-row strong {
    color: #1f3b57;
}







.autocomplete-wrapper {
    position: relative;
}

.autocomplete-wrapper .suggestions-box {
    position: absolute;
    z-index: 1000;
    width: 100%;
}










.hour-item {
    border-left: 6px solid #d1d5db;
}

.hour-item.estado-disponible {
    background: #ecfdf5;
    border-left-color: #22c55e;
}

.hour-item.estado-reservada,
.hour-item.estado-confirmada {
    background: #eff6ff;
    border-left-color: #2563eb;
}

.hour-item.estado-bloqueada {
    background: #f3f4f6;
    border-left-color: #6b7280;
}

.hour-item.estado-cancelada {
    background: #fef2f2;
    border-left-color: #dc2626;
}

.hour-item.estado-no_asiste {
    background: #fff7ed;
    border-left-color: #f97316;
}

.hour-item.estado-realizada {
    background: #f0fdf4;
    border-left-color: #16a34a;
}



.hour-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-info {
    display: grid;
    gap: 5px;
}

.switch-slot {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 32px;
}

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

.slider-slot {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: .25s;
    border-radius: 999px;
}

.slider-slot:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .25s;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.switch-slot input:checked + .slider-slot {
    background-color: #22c55e;
}

.switch-slot input:checked + .slider-slot:before {
    transform: translateX(26px);
}







.drop-zone {
    border: 2px dashed #94a3b8;
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: 0.2s;
}

.drop-zone:hover {
    background: #eef6ff;
    border-color: #1f3b57;
}

.drop-zone input {
    display: none;
}

.drop-zone strong {
    display: block;
    color: #1f3b57;
    font-size: 18px;
}

.drop-zone span,
.drop-zone small {
    display: block;
    color: #6b7280;
    margin-top: 6px;
}












.login-body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #6d2c91, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 390px;
    background: white;
    padding: 35px;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

.login-card h1 {
    color: #6d2c91;
    text-align: center;
    margin: 0;
}

.login-card h2 {
    color: #6d2c91;
    text-align: center;
    margin: 0;
}

.login-card p {
    text-align: center;
    color: #4b5563;
    margin-bottom: 25px;
}

.login-card label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
}

.login-card button {
    width: 100%;
    margin-top: 25px;
    padding: 13px;
    background: #6d2c91;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
}

.logout-btn {
    margin-top: 20px;
    color: #fecaca !important;
}

.logout-btn:hover {
    background: #7f1d1d !important;
    color: white !important;
}







.dashboard-header {
    background: linear-gradient(135deg, #ffffff, #f3e8ff);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

.dashboard-header h1 {
    margin: 6px 0;
    color: #4c1d95;
    font-size: 34px;
}

.dashboard-header p {
    margin: 0;
    color: #6b7280;
}

.eyebrow {
    color: #7c3aed;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-box {
    background: white;
    border-radius: 18px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 230px;
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.08);
}

.user-box span {
    font-size: 28px;
}

.user-box strong {
    display: block;
    color: #111827;
}

.user-box small {
    color: #6b7280;
    text-transform: capitalize;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    background: white;
    border-radius: 22px;
    padding: 22px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
    border-left: 6px solid #7c3aed;
}

.stat-card h3 {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
}

.stat-card p {
    margin: 8px 0 0;
    font-size: 32px;
    font-weight: 800;
    color: #111827;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: #f3e8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.stat-card.blue {
    border-left-color: #2563eb;
}

.stat-card.blue .stat-icon {
    background: #dbeafe;
}

.stat-card.green {
    border-left-color: #059669;
}

.stat-card.green .stat-icon {
    background: #d1fae5;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.quick-card {
    background: #111827;
    color: white;
    border-radius: 20px;
    padding: 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: 0.2s;
}

.quick-card:hover {
    transform: translateY(-3px);
    background: #4c1d95;
}

.quick-card span {
    font-size: 28px;
}

.quick-card h3 {
    margin: 0;
}

.quick-card p {
    margin: 5px 0 0;
    color: #d1d5db;
}

.dashboard-panel {
    border-radius: 22px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.panel-header h2 {
    margin: 0;
    color: #111827;
}

.panel-header p {
    margin: 5px 0 0;
    color: #6b7280;
}

@media (max-width: 900px) {
    .dashboard-header,
    .dashboard-cards,
    .quick-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-cards,
    .quick-actions {
        display: grid;
    }

    .user-box {
        width: 100%;
    }
}












.modal-paciente {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.modal-paciente-content {
    background: white;
    width: 760px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.25);
}

.modal-paciente-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
}

.modal-paciente-header h2 {
    margin: 0;
    color: #1f3b57;
}

.modal-paciente-header p {
    margin: 6px 0 0;
    color: #6b7280;
}

.modal-close {
    border: none;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 26px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.modal-form textarea {
    grid-column: span 2;
}

.modal-actions {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}







.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
}

.pagination span {
    color: #6b7280;
    font-weight: 600;
}












.patient-link {
    color: #1f3b57;
    font-weight: 700;
    text-decoration: none;
}

.patient-link:hover {
    text-decoration: underline;
    color: #2c587f;
}










.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.panel-header h2 {
    margin: 0;
}

.panel-header p {
    margin: 6px 0 0;
    color: #6b7280;
}

.table-responsive {
    overflow-x: auto;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
}

.pagination span {
    color: #6b7280;
    font-weight: 600;
}










.agenda-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.agenda-filters .btn-secondary.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.agenda-date-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}

.agenda-date-filter label {
    width: 100%;
    font-weight: 600;
}

.agenda-date-filter input[type="date"] {
    min-width: 220px;
}







html {
    scroll-behavior: smooth;
}

#horas-agendadas {
    scroll-margin-top: 20px;
}





.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-danger:hover {
    background: #fecaca;
    color: #991b1b;
}









.form-agenda-modern {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 24px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-field select {
    cursor: pointer;
}

.form-field textarea {
    min-height: 120px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-field select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.form-actions-modern {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.form-actions-modern .btn-primary {
    min-width: 170px;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
}

.autocomplete-wrapper {
    position: relative;
}

.suggestions-box {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.suggestion-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eef2f7;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8fafc;
}

.suggestion-item strong {
    color: #0f172a;
}

.suggestion-item span {
    font-size: 13px;
    color: #64748b;
}

@media (max-width: 820px) {
    .form-agenda-modern {
        grid-template-columns: 1fr;
    }

    .form-field-full {
        grid-column: auto;
    }

    .form-actions-modern {
        justify-content: stretch;
    }

    .form-actions-modern .btn-primary {
        width: 100%;
    }
}








.agenda-booking-panel {
    padding: 28px;
}

.agenda-booking-panel .panel-header {
    margin-bottom: 6px;
}

.agenda-booking-panel h2 {
    margin-bottom: 6px;
}

.agenda-booking-panel .panel-header p {
    color: #64748b;
    margin: 0;
}










.agenda-list-panel {
    padding: 28px;
}

.agenda-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.agenda-list-header h2 {
    margin: 4px 0 6px;
}

.agenda-list-header p {
    margin: 0;
    color: #64748b;
}

.agenda-view-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
}



.agenda-filters-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.agenda-filter-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    text-decoration: none;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.agenda-filter-tab:hover {
    background: #eef2ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.agenda-filter-tab.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.agenda-date-filter-modern {
    display: flex;
    align-items: flex-end;
}

.agenda-date-control {
    width: 100%;
    max-width: 460px;
}

.agenda-date-control label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.agenda-date-row {
    display: flex;
    gap: 10px;
}

.agenda-date-row input[type="date"] {
    flex: 1;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    box-sizing: border-box;
}

.agenda-date-row input[type="date"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.agenda-date-row .btn-primary {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
}

.agenda-table-wrapper {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.agenda-table-wrapper table {
    margin: 0;
}

.agenda-table-wrapper thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.agenda-table-wrapper tbody tr {
    transition: background 0.2s ease;
}

.agenda-table-wrapper tbody tr:hover {
    background: #f8fafc;
}

.empty-agenda-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 38px 20px;
    color: #64748b;
    text-align: center;
}

.empty-agenda-state strong {
    color: #0f172a;
    font-size: 16px;
}

.empty-agenda-icon {
    font-size: 34px;
    margin-bottom: 4px;
}

@media (max-width: 720px) {
    .agenda-list-header {
        flex-direction: column;
    }

    .agenda-date-row {
        flex-direction: column;
    }

    .agenda-date-row .btn-primary {
        width: 100%;
    }

    .agenda-filter-tab {
        flex: 1 1 calc(50% - 10px);
    }
}







.patients-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.patients-header h1 {
    margin: 4px 0 6px;
    font-size: 34px;
    color: #17324d;
}

.patients-header p {
    margin: 0;
    color: #64748b;
}

.btn-new-patient {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    background: #173b5f;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(23, 59, 95, 0.18);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.btn-new-patient:hover {
    background: #214f7b;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(23, 59, 95, 0.22);
}

.btn-new-patient span {
    font-size: 20px;
    line-height: 1;
}

.patients-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.patient-stat-card {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 150px;
    padding: 24px;
    border: 1px solid #e6edf5;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.patient-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #eff6ff;
    font-size: 25px;
}

.patient-stat-card span {
    display: block;
    margin-bottom: 7px;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.patient-stat-card strong {
    display: block;
    color: #17324d;
    font-size: 36px;
    line-height: 1;
}

.patient-stat-card strong.stat-text {
    font-size: 26px;
}

.patient-stat-card small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 13px;
}

.patient-search-panel {
    padding: 26px;
    overflow: visible;
}

.patient-search-header {
    margin-bottom: 20px;
}

.patient-search-header h2 {
    margin: 4px 0 6px;
    color: #17324d;
}

.patient-search-header p {
    margin: 0;
    color: #64748b;
}

.patient-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    overflow: visible;
}

.patient-search-input {
    position: relative;
    min-width: 0;
}

.patient-search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
    pointer-events: none;
}

.patient-search-input input {
    width: 100%;
    min-height: 50px;
    padding: 13px 16px 13px 44px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.patient-search-input input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.patient-search-form .btn-primary,
.patient-search-form .btn-secondary {
    min-height: 50px;
    padding: 0 20px;
    border-radius: 14px;
}

.patient-search-footer {
    margin-top: 14px;
}

.patient-toggle-list {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: #eef2f7;
    color: #334155;
    font-weight: 600;
    text-decoration: none;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.patient-toggle-list:hover {
    background: #e2e8f0;
    color: #17324d;
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .patients-stats {
        grid-template-columns: 1fr;
    }

    .patient-search-form {
        grid-template-columns: 1fr;
    }

    .patient-search-form .btn-primary,
    .patient-search-form .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .patients-header {
        flex-direction: column;
    }

    .btn-new-patient {
        width: 100%;
        justify-content: center;
    }

    .patient-stat-card {
        min-height: auto;
    }
}





.patient-search-wrapper {
    position: relative;
    width: 100%;
}

.patient-suggestions-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 9999;

    display: none;
    max-height: 320px;
    overflow-y: auto;

    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.patient-suggestions-box .suggestion-item {
    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 13px 15px;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;

    border-bottom: 1px solid #eef2f7;
    transition: background 0.2s ease;
}

.patient-suggestions-box .suggestion-item:last-child {
    border-bottom: none;
}

.patient-suggestions-box .suggestion-item:hover {
    background: #f8fafc;
}

.patient-suggestions-box .suggestion-item strong {
    color: #0f172a;
    font-size: 14px;
}

.patient-suggestions-box .suggestion-item span {
    color: #64748b;
    font-size: 13px;
}

.patient-suggestions-box .suggestion-empty {
    cursor: default;
    color: #64748b;
}









.imed-form-panel,
.imed-library-panel {
    padding: 28px;
}

.imed-template-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 24px;
}

.imed-diagnosis-card {
    grid-column: 1 / -1;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
}

.imed-diagnosis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.imed-diagnosis-header > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.imed-diagnosis-header h3 {
    margin: 0;
    color: #17324d;
}

.imed-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 800;
}

.imed-diagnosis-grid {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
}

.imed-textarea {
    min-height: 110px;
}

.imed-character-counter {
    margin-top: 7px;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
}

.counter-safe {
    color: #15803d;
}

.counter-warning {
    color: #d97706;
}

.counter-limit {
    color: #dc2626;
}

.imed-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.imed-template-card {
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.imed-template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.imed-template-card-header h3 {
    margin: 5px 0 0;
    color: #17324d;
}

.imed-template-description {
    margin: 14px 0;
    color: #64748b;
}

.imed-template-summary {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 18px 0;
}

.imed-summary-item {
    display: grid;
    grid-template-columns: 85px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
}

.imed-summary-item strong {
    color: #1d4ed8;
}

.imed-summary-item span {
    color: #334155;
}

@media (max-width: 850px) {
    .imed-template-form,
    .imed-template-grid,
    .imed-diagnosis-grid {
        grid-template-columns: 1fr;
    }

    .imed-diagnosis-card,
    .form-field-full {
        grid-column: auto;
    }
}








.diagnosis-autocomplete {
    position: relative;
}

.diagnosis-suggestions {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    z-index: 1000;

    display: none;
    max-height: 320px;
    overflow-y: auto;

    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.diagnosis-suggestion-item {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    padding: 12px 14px;

    border: none;
    border-bottom: 1px solid #eef2f7;
    background: #ffffff;

    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.diagnosis-suggestion-item:last-child {
    border-bottom: none;
}

.diagnosis-suggestion-item:hover {
    background: #f8fafc;
}

.diagnosis-suggestion-item strong {
    color: #1d4ed8;
    font-size: 14px;
}

.diagnosis-suggestion-item div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.diagnosis-suggestion-item span {
    color: #0f172a;
    font-size: 14px;
}

.diagnosis-suggestion-item small {
    color: #64748b;
    font-size: 12px;
}

.diagnosis-suggestion-empty {
    padding: 14px;
    color: #64748b;
    font-size: 14px;
}

.cie-diagnostico[readonly] {
    background: #f1f5f9;
    color: #1d4ed8;
    font-weight: 700;
}







.clinical-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.clinical-dashboard-header h1 {
    margin: 4px 0 7px;
    color: #17324d;
    font-size: 35px;
}

.clinical-dashboard-header p {
    margin: 0;
    color: #64748b;
}

.clinical-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.clinical-metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 132px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.clinical-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
}

.clinical-metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    font-size: 25px;
}

.metric-blue .clinical-metric-icon {
    background: #dbeafe;
}

.metric-purple .clinical-metric-icon {
    background: #f3e8ff;
}

.metric-green .clinical-metric-icon {
    background: #dcfce7;
}

.metric-orange .clinical-metric-icon {
    background: #ffedd5;
}

.clinical-metric-card span {
    display: block;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.clinical-metric-card strong {
    display: block;
    margin: 7px 0;
    color: #17324d;
    font-size: 34px;
    line-height: 1;
}

.clinical-metric-card small {
    color: #94a3b8;
    font-size: 12px;
}

.dashboard-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 24px;
}

.dashboard-summary-panel {
    padding: 26px;
}

.dashboard-panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #f1f5f9;
    font-size: 22px;
}

.dashboard-summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.dashboard-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 54px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
}

.dashboard-summary-row span {
    color: #334155;
    font-weight: 600;
}

.dashboard-summary-row small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
}

.dashboard-summary-row strong {
    color: #17324d;
    font-size: 19px;
}

.dashboard-panel-link {
    display: inline-flex;
    margin-top: 17px;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-panel-link:hover {
    text-decoration: underline;
}

@media (max-width: 1100px) {
    .clinical-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .clinical-dashboard-header {
        flex-direction: column;
    }

    .clinical-dashboard-grid,
    .dashboard-two-columns {
        grid-template-columns: 1fr;
    }
}










.dashboard-alerts-panel,
.dashboard-today-panel {
    padding: 26px;
    margin-bottom: 24px;
}

.dashboard-alerts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.dashboard-alert-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.dashboard-alert-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.dashboard-alert-icon {
    font-size: 25px;
}

.dashboard-alert-card strong {
    display: block;
    color: #17324d;
    font-size: 23px;
}

.dashboard-alert-card div span {
    color: #64748b;
    font-size: 13px;
}

.dashboard-table-wrapper {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.dashboard-table-wrapper table {
    margin: 0;
}

.dashboard-table-wrapper thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dashboard-table-wrapper tbody tr {
    transition: background 0.2s ease;
}

.dashboard-table-wrapper tbody tr:hover {
    background: #f8fafc;
}

.dashboard-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 34px;
    color: #64748b;
    text-align: center;
}

.dashboard-empty-state > span {
    font-size: 32px;
}

.dashboard-empty-state strong {
    color: #17324d;
}

@media (max-width: 1100px) {
    .dashboard-alerts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .dashboard-alerts-grid {
        grid-template-columns: 1fr;
    }
}


.text-muted{
    color:#94a3b8;
    font-style:italic;
}







.patient-profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.patient-profile-identity {
    display: flex;
    align-items: center;
    gap: 18px;
}

.patient-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(
        135deg,
        #dbeafe,
        #e0e7ff
    );
    color: #1d4ed8;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.patient-profile-header h1 {
    margin: 4px 0 8px;
    color: #17324d;
    font-size: 32px;
}

.patient-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.patient-profile-meta span {
    padding: 7px 11px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 13px;
}

.patient-profile-meta strong {
    color: #334155;
}

.patient-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.patient-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.patient-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.patient-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 45px;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #eff6ff;
    font-size: 21px;
}

.patient-summary-card div:last-child {
    min-width: 0;
}

.patient-summary-card span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.patient-summary-card strong {
    display: block;
    overflow: hidden;
    color: #17324d;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-module-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 7px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.patient-module-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 11px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.patient-module-tab:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.patient-module-tab.active {
    background: #173b5f;
    color: #ffffff;
}

.patient-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 22px;
    margin-bottom: 24px;
}

.patient-personal-panel,
.patient-modules-panel,
.patient-attentions-panel {
    padding: 26px;
}

.patient-data-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 18px;
}

.patient-data-row {
    display: grid;
    grid-template-columns: 155px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 48px;
    padding: 11px 14px;
    border-radius: 12px;
    background: #f8fafc;
}

.patient-data-row > span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.patient-data-row strong {
    color: #334155;
    font-size: 14px;
    font-weight: 600;
}

.patient-observations-box {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.patient-observations-box > span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.patient-observations-box p {
    margin: 9px 0 0;
    color: #334155;
    line-height: 1.6;
}

.patient-clinical-modules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.patient-clinical-module {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.patient-clinical-module:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 9px 22px rgba(15, 23, 42, 0.07);
}

.patient-clinical-module > span {
    font-size: 23px;
}

.patient-clinical-module div {
    min-width: 0;
}

.patient-clinical-module strong,
.patient-clinical-module small {
    display: block;
}

.patient-clinical-module strong {
    color: #17324d;
    font-size: 14px;
}

.patient-clinical-module small {
    margin-top: 3px;
    overflow: hidden;
    color: #94a3b8;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-attention-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 20px;
}

.patient-attention-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 13px;
}

.patient-attention-item:not(:last-child)::before {
    position: absolute;
    top: 22px;
    bottom: -21px;
    left: 7px;
    width: 2px;
    background: #dbeafe;
    content: "";
}

.patient-attention-marker {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin-top: 18px;
    border: 4px solid #dbeafe;
    border-radius: 50%;
    background: #2563eb;
}

.patient-attention-content {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.patient-attention-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

.patient-attention-header strong {
    color: #17324d;
}

.patient-attention-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.patient-attention-summary > div {
    min-width: 0;
    padding: 13px;
    border-radius: 12px;
    background: #ffffff;
}

.patient-attention-summary span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.patient-attention-summary p {
    margin: 7px 0 0;
    overflow: hidden;
    color: #334155;
    font-size: 13px;
    line-height: 1.55;

    display: -webkit-box;
    -webkit-box-orient: vertical;

    line-clamp: 5;
    -webkit-line-clamp: 5;
}




.patient-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 38px 20px;
    text-align: center;
}

.patient-empty-state > span {
    font-size: 36px;
}

.patient-empty-state strong {
    color: #17324d;
    font-size: 17px;
}

.patient-empty-state p {
    margin: 0 0 8px;
    color: #64748b;
}

.text-muted {
    color: #94a3b8;
    font-style: italic;
    font-weight: 400;
}

@media (max-width: 1100px) {
    .patient-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .patient-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .patient-profile-header {
        flex-direction: column;
    }

    .patient-profile-actions {
        width: 100%;
    }

    .patient-profile-actions .btn-primary,
    .patient-profile-actions .btn-secondary {
        flex: 1;
        justify-content: center;
    }

    .patient-summary-grid,
    .patient-clinical-modules,
    .patient-attention-summary {
        grid-template-columns: 1fr;
    }

    .patient-data-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.patient-module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.patient-module-identity {
    display: flex;
    align-items: center;
    gap: 16px;
}

.patient-avatar-small {
    flex-basis: 60px;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 21px;
}

.patient-module-header h1 {
    margin: 4px 0 8px;
    color: #17324d;
    font-size: 29px;
}

.patient-module-section {
    margin-bottom: 24px;
    padding: 26px;
}

.patient-module-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.patient-module-title-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.patient-module-title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: #eff6ff;
    font-size: 23px;
}

.patient-module-title h2 {
    margin: 0 0 5px;
    color: #17324d;
}

.patient-module-title p {
    margin: 0;
    color: #64748b;
}

.patient-module-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.patient-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.patient-record-card {
    padding: 19px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.patient-record-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 11px 27px rgba(15, 23, 42, 0.08);
}

.patient-record-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.patient-record-card-header h3 {
    margin: 0;
    color: #17324d;
    font-size: 17px;
}

.patient-record-details {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.patient-record-row {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #f8fafc;
}

.patient-record-row span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.patient-record-row strong,
.patient-record-row p {
    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.patient-record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
}

@media (max-width: 900px) {
    .patient-record-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .patient-module-header,
    .patient-module-title {
        flex-direction: column;
    }

    .patient-module-toolbar {
        width: 100%;
    }

    .patient-record-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}










.module-context-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
    padding: 17px 19px;
    border: 1px solid #bfdbfe;
    border-left: 5px solid #2563eb;
    border-radius: 15px;
    background: #eff6ff;
}

.module-context-alert-icon {
    font-size: 25px;
}

.module-context-alert strong {
    color: #17324d;
}

.module-context-alert p {
    margin: 5px 0 0;
    color: #475569;
    line-height: 1.5;
}

.modern-clinical-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.modern-clinical-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-clinical-form .form-field-full {
    grid-column: 1 / -1;
}

.modern-clinical-form label {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.modern-clinical-form input,
.modern-clinical-form select,
.modern-clinical-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.modern-clinical-form textarea {
    resize: vertical;
    line-height: 1.6;
}

.modern-clinical-form input:focus,
.modern-clinical-form select:focus,
.modern-clinical-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.module-count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.clinical-attention-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.clinical-attention-card {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.clinical-attention-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.clinical-attention-card-header h3 {
    margin: 4px 0 0;
    color: #17324d;
}

.clinical-attention-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.clinical-attention-field {
    padding: 15px;
    border-radius: 13px;
    background: #f8fafc;
}

.clinical-attention-field > span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.clinical-attention-field p {
    margin: 8px 0 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 850px) {
    .modern-clinical-form,
    .clinical-attention-sections {
        grid-template-columns: 1fr;
    }

    .modern-clinical-form .form-field-full {
        grid-column: auto;
    }
}





.patients-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.patients-header h1 {
    margin: 4px 0 7px;
    color: #17324d;
    font-size: 34px;
}

.patients-header p {
    margin: 0;
    color: #64748b;
}

.btn-new-patient {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 19px;
    border: none;
    border-radius: 14px;
    background: #173b5f;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(23, 59, 95, 0.18);
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.btn-new-patient:hover {
    background: #214f7b;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(23, 59, 95, 0.23);
}

.btn-new-patient span {
    font-size: 21px;
}

.patients-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.patient-stat-card {
    display: flex;
    align-items: center;
    gap: 17px;
    min-height: 135px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 19px;
    background: #ffffff;
    box-shadow: 0 9px 27px rgba(15, 23, 42, 0.06);
}

.patient-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 53px;
    width: 53px;
    height: 53px;
    border-radius: 16px;
    background: #eff6ff;
    font-size: 24px;
}

.patient-stat-card span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.patient-stat-card strong {
    display: block;
    color: #17324d;
    font-size: 33px;
    line-height: 1;
}

.patient-stat-card strong.stat-text {
    font-size: 24px;
}

.patient-stat-card small {
    display: block;
    margin-top: 7px;
    color: #94a3b8;
    font-size: 12px;
}

.patient-search-panel,
.patients-results-panel {
    padding: 26px;
    overflow: visible;
}

.patient-search-header {
    margin-bottom: 19px;
}

.patient-search-header h2 {
    margin: 4px 0 6px;
    color: #17324d;
}

.patient-search-header p {
    margin: 0;
    color: #64748b;
}

.patient-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    overflow: visible;
}

.patient-search-input {
    position: relative;
    min-width: 0;
}

.patient-search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.patient-search-input input {
    width: 100%;
    min-height: 50px;
    box-sizing: border-box;
    padding: 13px 16px 13px 44px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
}

.patient-search-input input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.patient-search-form .btn-primary,
.patient-search-form .btn-secondary {
    min-height: 50px;
    padding: 0 20px;
    border-radius: 14px;
}

.patient-suggestions-box {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 9999;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.patient-suggestions-box .suggestion-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 15px;
    border-bottom: 1px solid #eef2f7;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
}

.patient-suggestions-box .suggestion-item:hover {
    background: #f8fafc;
}

.patient-suggestions-box .suggestion-item:last-child {
    border-bottom: none;
}

.patient-suggestions-box .suggestion-item span {
    color: #64748b;
    font-size: 13px;
}

.patient-search-footer {
    margin-top: 15px;
}

.patient-toggle-list {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: #eef2f7;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.patient-toggle-list:hover {
    background: #e2e8f0;
}

.search-result-term {
    display: inline-flex;
    align-items: center;
    min-height: 37px;
    padding: 0 13px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
}

.patients-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-top: 20px;
}

.patient-list-card {
    display: grid;
    grid-template-columns:
        minmax(260px, 1.4fr)
        minmax(180px, 0.7fr)
        auto;
    gap: 18px;
    align-items: center;
    padding: 17px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.patient-list-card:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 9px 25px rgba(15, 23, 42, 0.07);
}

.patient-list-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.patient-list-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 47px;
    width: 47px;
    height: 47px;
    border-radius: 14px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 15px;
    font-weight: 800;
}

.patient-list-main {
    min-width: 0;
}

.patient-list-name {
    display: inline-block;
    overflow: hidden;
    max-width: 100%;
    color: #17324d;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-list-name:hover {
    color: #2563eb;
}

.patient-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 7px;
}

.patient-list-meta span {
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
}

.patient-list-meta strong {
    color: #334155;
}

.patient-list-contact {
    min-width: 0;
}

.patient-list-contact span,
.patient-list-contact strong {
    display: block;
}

.patient-list-contact span {
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.patient-list-contact strong {
    overflow: hidden;
    color: #334155;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-list-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-patient-open,
.btn-patient-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.btn-patient-open {
    background: #173b5f;
    color: #ffffff;
}

.btn-patient-open:hover {
    background: #214f7b;
}

.btn-patient-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-patient-delete:hover {
    background: #fecaca;
}

.patients-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 45px 20px;
    text-align: center;
}

.patients-empty-state > span {
    font-size: 38px;
}

.patients-empty-state strong {
    color: #17324d;
    font-size: 18px;
}

.patients-empty-state p {
    margin: 0 0 8px;
    color: #64748b;
}

.patients-pagination {
    margin-top: 22px;
}

@media (max-width: 1050px) {
    .patient-list-card {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .patient-list-contact {
        display: none;
    }
}

@media (max-width: 900px) {
    .patients-stats {
        grid-template-columns: 1fr;
    }

    .patient-search-form {
        grid-template-columns: 1fr;
    }

    .patient-search-form .btn-primary,
    .patient-search-form .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .patients-header {
        flex-direction: column;
    }

    .btn-new-patient {
        width: 100%;
    }

    .patient-list-card {
        grid-template-columns: 1fr;
    }

    .patient-list-actions {
        justify-content: flex-start;
    }

    .btn-patient-open,
    .btn-patient-delete {
        flex: 1;
    }
}







.weekly-agenda-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 26px;
    margin-bottom: 24px;
    overflow: hidden;
}

.weekly-agenda-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.weekly-agenda-header h2 {
    margin: 4px 0 6px;
    color: #17324d;
}

.weekly-agenda-header p {
    margin: 0;
    color: #64748b;
}

.weekly-agenda-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.weekly-agenda-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 21px 0 15px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.legend-item::before {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    content: "";
}

.legend-disponible {
    background: #ecfdf5;
    color: #047857;
}

.legend-disponible::before {
    background: #10b981;
}

.legend-reservada {
    background: #eff6ff;
    color: #1d4ed8;
}

.legend-reservada::before {
    background: #3b82f6;
}

.legend-confirmada {
    background: #eef2ff;
    color: #4338ca;
}

.legend-confirmada::before {
    background: #6366f1;
}

.legend-realizada {
    background: #f1f5f9;
    color: #475569;
}

.legend-realizada::before {
    background: #64748b;
}

.legend-bloqueada {
    background: #fef2f2;
    color: #b91c1c;
}

.legend-bloqueada::before {
    background: #ef4444;
}

.weekly-calendar-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;

    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;

    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #ffffff;
}

.weekly-calendar {
    display: grid;
    grid-template-columns:
        72px
        repeat(7, minmax(145px, 1fr));
    min-width: 1100px;
}

.weekly-time-header,
.weekly-day-header {
    position: sticky;
    top: 0;
    z-index: 4;
    min-height: 68px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.weekly-time-header {
    left: 0;
    z-index: 6;
    border-right: 1px solid #e2e8f0;
}

.weekly-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e2e8f0;
}

.weekly-day-header span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.weekly-day-header strong {
    margin-top: 3px;
    color: #17324d;
    font-size: 22px;
}

.weekly-day-header.is-today {
    background: #eff6ff;
}

.weekly-day-header.is-today strong {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
}

.weekly-time-column {
    position: relative;
    height: 1008px;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.weekly-time-label {
    height: 72px;
    box-sizing: border-box;
    padding: 5px 9px 0 0;
    border-bottom: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}

.weekly-day-column {
    position: relative;
    height: 1008px;
    border-right: 1px solid #e2e8f0;
    background: #ffffff;
}

.weekly-day-column.is-today {
    background: #f8fbff;
}

.weekly-hour-line {
    height: 72px;
    box-sizing: border-box;
    border-bottom: 1px solid #eef2f7;
}

.weekly-event {
    position: absolute;
    right: 5px;
    left: 5px;
    z-index: 2;
    min-height: 36px;
    box-sizing: border-box;
    padding: 7px 8px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 11px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.weekly-event strong,
.weekly-event span,
.weekly-event a,
.weekly-event small {
    display: block;
}

.weekly-event strong {
    margin-bottom: 3px;
    font-size: 11px;
}

.weekly-event a {
    overflow: hidden;
    color: inherit;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weekly-event small {
    margin-top: 3px;
    overflow: hidden;
    opacity: 0.78;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weekly-event.estado-disponible {
    border-color: #86efac;
    background: #dcfce7;
    color: #166534;
}

.weekly-event.estado-reservada {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1e40af;
}

.weekly-event.estado-confirmada {
    border-color: #a5b4fc;
    background: #e0e7ff;
    color: #3730a3;
}

.weekly-event.estado-realizada {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #475569;
}

.weekly-event.estado-bloqueada {
    border-color: #fca5a5;
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 850px) {
    .weekly-agenda-panel {
        padding: 18px 14px;
    }

    .weekly-agenda-header {
        flex-direction: column;
        gap: 18px;
    }

    .weekly-agenda-navigation {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 9px;
    }

    .weekly-agenda-navigation .btn-secondary {
        width: 100%;
        min-width: 0;
        min-height: 72px;
        padding: 10px 7px;
        box-sizing: border-box;
        white-space: normal;
        line-height: 1.2;
        text-align: center;
    }

    .weekly-agenda-legend {
        gap: 8px;
        margin: 18px 0 14px;
    }

    .legend-item {
        min-height: 32px;
        padding: 0 10px;
        font-size: 11px;
    }

    .weekly-calendar-scroll {
        width: 100%;
        max-width: 100%;
    }

    .weekly-calendar {
        grid-template-columns:
            58px
            repeat(7, 125px);

        width: max-content;
        min-width: max-content;
    }

    .weekly-day-header,
    .weekly-day-column {
        min-width: 125px;
    }

    .weekly-time-header,
    .weekly-day-header {
        min-height: 64px;
    }

    .weekly-time-column {
        position: sticky;
        left: 0;
        z-index: 3;
    }

    .weekly-time-label {
        padding-right: 7px;
        font-size: 10px;
    }

    .weekly-event {
        right: 4px;
        left: 4px;
        padding: 6px;
        font-size: 10px;
    }
}







.finance-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 27px;
}

.finance-page-header h1 {
    margin: 4px 0 7px;
    color: #17324d;
    font-size: 34px;
}

.finance-page-header p {
    margin: 0;
    color: #64748b;
}

.finance-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.finance-metric-card {
    display: flex;
    align-items: center;
    gap: 17px;
    min-width: 0;
    min-height: 138px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.finance-metric-card > div:last-child {
    flex: 1;
    min-width: 0;
}

.finance-metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    font-size: 25px;
}

.metric-paid .finance-metric-icon {
    background: #dcfce7;
}

.metric-month .finance-metric-icon,
.metric-cut .finance-metric-icon {
    background: #dbeafe;
}

.metric-pending .finance-metric-icon {
    background: #ffedd5;
}

.finance-metric-card span {
    display: block;
    margin-bottom: 7px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.finance-metric-card strong {
    display: block;
    max-width: 100%;
    color: #17324d;
    font-size: clamp(23px, 2vw, 28px);
    line-height: 1.1;
    white-space: nowrap;
}

.finance-metric-card small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 12px;
}

.finance-form-panel,
.finance-pending-panel,
.finance-history-panel,
.finance-close-panel,
.finance-detail-panel,
.finance-analysis-panel,
.finance-closures-panel {
    padding: 26px;
    margin-bottom: 24px;
}

.finance-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.finance-section-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.finance-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 22px;
    font-weight: 800;
}

.finance-icon-warning {
    background: #fff7ed;
    color: #c2410c;
}

.finance-section-header h2 {
    margin: 4px 0 5px;
    color: #17324d;
}

.finance-section-header p {
    margin: 0;
    color: #64748b;
}

.finance-modern-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.finance-modern-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finance-modern-form .form-field-full {
    grid-column: 1 / -1;
}

.finance-modern-form label {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.finance-modern-form input,
.finance-modern-form select,
.finance-modern-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
}

.finance-modern-form input:focus,
.finance-modern-form select:focus,
.finance-modern-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.finance-count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.finance-count-warning {
    background: #fff7ed;
    color: #c2410c;
}

.finance-record-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.finance-record-card {
    display: grid;
    grid-template-columns: minmax(260px, 1.3fr) auto auto;
    gap: 18px;
    align-items: center;
    padding: 17px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.finance-record-pending {
    border-left: 5px solid #f97316;
}

.finance-record-main {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.finance-record-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #ffedd5;
    color: #c2410c;
    font-weight: 800;
}

.finance-record-patient {
    color: #17324d;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.finance-record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 6px;
}

.finance-record-meta span {
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
}

.finance-record-amount span,
.finance-record-amount strong {
    display: block;
    text-align: right;
}

.finance-record-amount span {
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: 11px;
}

.finance-record-amount strong {
    color: #c2410c;
    font-size: 19px;
}

.finance-record-actions,
.finance-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-finance-edit,
.btn-finance-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.btn-finance-edit {
    background: #173b5f;
    color: #ffffff;
}

.btn-finance-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.finance-table-wrapper {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.finance-table-wrapper table {
    margin: 0;
}

.finance-table-wrapper thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
}

.finance-money {
    color: #17324d;
    white-space: nowrap;
}

.finance-net-money {
    color: #047857;
    white-space: nowrap;
}

.payment-method-badge,
.payment-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.payment-method-badge {
    background: #f1f5f9;
    color: #475569;
}

.payment-status-badge.status-pagado,
.payment-status-badge.status-cerrado,
.payment-status-badge.status-completado {
    background: #dcfce7;
    color: #166534;
}

.payment-status-badge.status-pendiente,
.payment-status-badge.status-abierto {
    background: #ffedd5;
    color: #c2410c;
}

.finance-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 36px 20px;
    text-align: center;
}

.finance-empty-state > span {
    font-size: 34px;
}

.finance-empty-state strong {
    color: #17324d;
}

.finance-empty-state p {
    margin: 0;
    color: #64748b;
}

.finance-empty-state.compact {
    padding: 25px;
}

.finance-secondary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.finance-secondary-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    padding: 19px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #ffffff;
    overflow: hidden;
}

.finance-secondary-card > div {
    flex: 1;
    min-width: 0;
}

.finance-secondary-card > span {
    font-size: 26px;
}

.finance-secondary-card small {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.finance-secondary-card strong {
    display: block;
    margin: 5px 0;
    color: #17324d;
    font-size: 27px;
}

.finance-secondary-card p {
    margin: 0;
    color: #94a3b8;
    font-size: 11px;
}

.finance-close-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px;
    border-radius: 15px;
    background: #f8fafc;
}

.finance-close-summary span,
.finance-close-summary strong,
.finance-close-summary small {
    display: block;
}

.finance-close-summary span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.finance-close-summary strong {
    margin: 6px 0;
    color: #17324d;
    font-size: 27px;
}

.finance-close-summary small {
    color: #047857;
}

.finance-analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 24px;
}

.finance-analysis-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.finance-analysis-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 15px;
    border-radius: 13px;
    background: #f8fafc;
}

.finance-analysis-row span,
.finance-analysis-row small {
    display: block;
}

.finance-analysis-row span {
    color: #334155;
    font-weight: 700;
}

.finance-analysis-row small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 11px;
}

.finance-analysis-row strong {
    color: #17324d;
}

/* Pantallas medianas: MacBook, tablet horizontal y ventanas reducidas */
@media (min-width: 901px) and (max-width: 1250px) {
    .finance-metrics-grid,
    .finance-secondary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-metric-card strong {
        font-size: clamp(23px, 2.8vw, 28px);
    }
}

@media (max-width: 1050px) {
    .finance-record-card {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .finance-record-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .finance-metrics-grid,
    .finance-secondary-metrics,
    .finance-analysis-grid {
        grid-template-columns: 1fr;
    }

    .finance-modern-form {
        grid-template-columns: 1fr;
    }

    .finance-modern-form .form-field-full {
        grid-column: auto;
    }

    .finance-metric-card strong {
        font-size: 28px;
    }
}

@media (max-width: 720px) {
    .finance-page-header,
    .finance-close-content,
    .finance-section-header {
        flex-direction: column;
    }

    .finance-record-card {
        grid-template-columns: 1fr;
    }

    .finance-record-amount span,
    .finance-record-amount strong {
        text-align: left;
    }

    .finance-record-actions {
        grid-column: auto;
    }
}










.licenses-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 27px;
}

.licenses-page-header h1 {
    margin: 4px 0 7px;
    color: #17324d;
    font-size: 34px;
}

.licenses-page-header p {
    margin: 0;
    color: #64748b;
}

.licenses-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.licenses-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 24px;
}

.license-metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 132px;
    padding: 21px;
    border: 1px solid #e2e8f0;
    border-radius: 19px;
    background: #ffffff;
    box-shadow: 0 9px 27px rgba(15, 23, 42, 0.06);
}

.license-metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 24px;
}

.metric-license-active .license-metric-icon {
    background: #dcfce7;
}

.metric-license-warning .license-metric-icon {
    background: #ffedd5;
}

.metric-license-month .license-metric-icon {
    background: #dbeafe;
}

.metric-license-history .license-metric-icon {
    background: #f3e8ff;
}

.license-metric-card span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.license-metric-card strong {
    display: block;
    color: #17324d;
    font-size: 32px;
    line-height: 1;
}

.license-metric-card small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 11px;
}

.license-expiration-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 24px;
    padding: 17px 19px;
    border: 1px solid #fed7aa;
    border-left: 5px solid #f97316;
    border-radius: 16px;
    background: #fff7ed;
}

.license-expiration-icon {
    font-size: 26px;
}

.license-expiration-alert div:nth-child(2) {
    flex: 1;
}

.license-expiration-alert strong {
    color: #9a3412;
}

.license-expiration-alert p {
    margin: 5px 0 0;
    color: #c2410c;
    font-size: 13px;
}

.licenses-active-panel,
.licenses-history-panel {
    padding: 26px;
    margin-bottom: 24px;
}

.licenses-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.licenses-section-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.licenses-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: #eff6ff;
    font-size: 22px;
}

.licenses-section-header h2 {
    margin: 4px 0 5px;
    color: #17324d;
}

.licenses-section-header p {
    margin: 0;
    color: #64748b;
}

.licenses-count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 800;
}

.licenses-active-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.license-active-card {
    display: grid;
    grid-template-columns:
        minmax(230px, 1.1fr)
        minmax(190px, 0.8fr)
        minmax(180px, 0.8fr)
        auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #22c55e;
    border-radius: 16px;
    background: #ffffff;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.license-active-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 25px rgba(15, 23, 42, 0.07);
}

.license-active-card.license-near-expiration {
    border-left-color: #f97316;
    background: #fffdfa;
}

.license-patient-identity {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.license-patient-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 47px;
    width: 47px;
    height: 47px;
    border-radius: 14px;
    background: #dcfce7;
    color: #166534;
    font-size: 15px;
    font-weight: 800;
}

.license-near-expiration .license-patient-avatar {
    background: #ffedd5;
    color: #c2410c;
}

.license-patient-name {
    color: #17324d;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.license-patient-name:hover {
    color: #2563eb;
}

.license-patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 6px;
}

.license-patient-meta span {
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
}

.license-period span,
.license-period strong,
.license-period small,
.license-diagnosis span,
.license-diagnosis strong {
    display: block;
}

.license-period > span,
.license-diagnosis > span {
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.license-period strong,
.license-diagnosis strong {
    color: #334155;
    font-size: 13px;
}

.license-period strong span {
    display: inline;
    margin: 0 4px;
    color: #94a3b8;
}

.license-period small {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
}

.license-days-warning {
    color: #c2410c !important;
    font-weight: 700;
}

.license-diagnosis strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.license-active-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.license-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.license-status-badge.status-vigente {
    background: #dcfce7;
    color: #166534;
}

.license-status-badge.status-vencida {
    background: #f1f5f9;
    color: #64748b;
}

.licenses-table-wrapper {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.licenses-table-wrapper table {
    margin: 0;
}

.licenses-table-wrapper thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
}

.license-diagnosis-cell {
    max-width: 270px;
}

.licenses-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 38px 20px;
    text-align: center;
}

.licenses-empty-state > span {
    font-size: 35px;
}

.licenses-empty-state strong {
    color: #17324d;
}

.licenses-empty-state p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 1150px) {
    .licenses-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .license-active-card {
        grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
    }

    .license-diagnosis {
        grid-column: 1;
    }

    .license-active-actions {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 760px) {
    .licenses-page-header,
    .licenses-section-header,
    .license-expiration-alert {
        flex-direction: column;
    }

    .licenses-header-actions {
        width: 100%;
    }

    .licenses-header-actions .btn-primary,
    .licenses-header-actions .btn-secondary {
        flex: 1;
        justify-content: center;
    }

    .licenses-metrics-grid,
    .license-active-card {
        grid-template-columns: 1fr;
    }

    .license-diagnosis,
    .license-active-actions {
        grid-column: auto;
        grid-row: auto;
    }

    .license-active-actions {
        justify-content: flex-start;
    }
}













.modern-login-body {
    min-height: 100vh;
    margin: 0;
    background: #f4f7fb;
    color: #0f172a;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.modern-login-layout {
    display: grid;
    grid-template-columns:
        minmax(420px, 1.1fr)
        minmax(430px, 0.9fr);
    min-height: 100vh;
}

/* Panel de imagen */

.login-visual-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    overflow: hidden;
    padding: 42px 48px;
    box-sizing: border-box;

   background-image:
    linear-gradient(
        180deg,
        rgba(255,255,255,0.05),
        rgba(10,35,61,0.20)
    ),
        url("../assets/imagenes/NADIEL.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-visual-panel::after {
    position: absolute;
    right: -140px;
    bottom: -170px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    content: "";
}

.login-visual-overlay{

    background:
        radial-gradient(
            circle at 25% 15%,
            rgba(255,255,255,.22),
            transparent 38%
        ),
        linear-gradient(
            to top,
            rgba(7,26,44,.15),
            transparent 65%
        );
}

.login-brand,
.login-visual-content,
.login-visual-footer {
    position: relative;
    z-index: 2;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    color: #ffffff;
}

.login-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 47px;
    height: 47px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 23px;
    font-weight: 700;
    backdrop-filter: blur(12px);
}

.login-brand span,
.login-brand strong {
    display: block;
}

.login-brand span {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
    font-weight: 600;
}

.login-brand strong {
    font-size: 17px;
}

.login-visual-content {
    max-width: 560px;
    margin: auto 0;
    padding: 70px 0;
    color: #ffffff;
}

.login-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-visual-content .login-eyebrow {
    color: rgba(255, 255, 255, 0.75);
}

.login-visual-content h1 {
    max-width: 600px;
    margin: 0 0 19px;
    font-size: clamp(36px, 4vw, 58px);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.login-visual-content p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, 0.79);
    font-size: 16px;
    line-height: 1.7;
}

.login-features {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 28px;
}

.login-features span {
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    color: rgba(255, 255, 255, 0.91);
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.login-visual-footer {
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
}

/* Lado del formulario */

.login-form-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 42px 60px 30px;
    box-sizing: border-box;
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(219, 234, 254, 0.7),
            transparent 30%
        ),
        #f8fafc;
}

.modern-login-card {
    width: min(440px, 100%);
    padding: 39px;
    box-sizing: border-box;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 28px 70px rgba(15, 23, 42, 0.11),
        0 3px 10px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(18px);
}

.modern-login-header {
    margin-bottom: 27px;
}

.modern-login-header h2 {
    margin: 0 0 8px;
    color: #17324d;
    font-size: 31px;
    letter-spacing: -0.025em;
}

.modern-login-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
}

.modern-login-form {
    display: flex;
    flex-direction: column;
    gap: 19px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.login-field label {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.login-forgot-link {
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.login-forgot-link:hover {
    text-decoration: underline;
}

.login-input-wrapper {
    position: relative;
}

.login-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
}

.login-input-wrapper input {
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    padding: 13px 46px 13px 43px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 14px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.login-input-wrapper input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    padding: 0;
    transform: translateY(-50%);
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover {
    background: #f1f5f9;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.remember-control {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
}

.remember-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.remember-box {
    position: relative;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
}

.remember-control input:checked + .remember-box {
    border-color: #2563eb;
    background: #2563eb;
}

.remember-control input:checked + .remember-box::after {
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    transform: rotate(45deg);
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    content: "";
}

.modern-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 52px;
    margin-top: 2px;
    padding: 0 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #173b5f, #2563eb);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.2);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.modern-login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.26);
}

.login-security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 25px;
    padding: 13px;
    border-radius: 13px;
    background: #f8fafc;
}

.login-security-note p {
    margin: 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.5;
}

.login-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
}

.login-page-footer {
    margin-top: 24px;
    color: #94a3b8;
    font-size: 11px;
}

.login-mobile-brand {
    display: none;
}

/* Adaptación */

@media (max-width: 980px) {
    .modern-login-layout {
        grid-template-columns: 0.9fr 1.1fr;
    }

    .login-visual-panel {
        padding: 35px;
    }

    .login-form-side {
        padding: 35px;
    }
}

@media (max-width: 760px) {
    .modern-login-layout {
        display: block;
    }

    .login-visual-panel {
        display: none;
    }

    .login-form-side {
        min-height: 100vh;
        padding: 26px 20px;
    }

    .login-mobile-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        width: min(440px, 100%);
        margin-bottom: 20px;
    }

    .login-mobile-brand .login-brand-icon {
        border-color: #dbeafe;
        background: #dbeafe;
        color: #1d4ed8;
    }

    .login-mobile-brand span,
    .login-mobile-brand strong {
        display: block;
    }

    .login-mobile-brand span {
        color: #64748b;
        font-size: 11px;
    }

    .login-mobile-brand strong {
        color: #17324d;
    }

    .modern-login-card {
        padding: 29px 23px;
        border-radius: 22px;
    }
}









.audit-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 27px;
}

.audit-page-header h1 {
    margin: 4px 0 7px;
    color: #17324d;
    font-size: 34px;
}

.audit-page-header p {
    margin: 0;
    color: #64748b;
}

.audit-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 24px;
}

.audit-metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 126px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 19px;
    background: #ffffff;
    box-shadow: 0 9px 27px rgba(15, 23, 42, 0.06);
}

.audit-metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 51px;
    width: 51px;
    height: 51px;
    border-radius: 16px;
    background: #eff6ff;
    font-size: 24px;
}

.audit-metric-card span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.audit-metric-card strong {
    display: block;
    color: #17324d;
    font-size: 30px;
    line-height: 1;
}

.audit-metric-card small {
    display: block;
    margin-top: 7px;
    color: #94a3b8;
    font-size: 11px;
}

.audit-filters-panel,
.audit-events-panel {
    padding: 26px;
    margin-bottom: 24px;
}

.audit-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.audit-section-header h2 {
    margin: 4px 0 5px;
    color: #17324d;
}

.audit-section-header p {
    margin: 0;
    color: #64748b;
}

.audit-filter-form {
    display: grid;
    grid-template-columns:
        minmax(240px, 1.4fr)
        repeat(5, minmax(145px, 0.7fr));
    gap: 14px;
    align-items: end;
}

.audit-filter-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.audit-filter-form label {
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.audit-filter-form input,
.audit-filter-form select {
    width: 100%;
    min-height: 45px;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 13px;
}

.audit-filter-form input:focus,
.audit-filter-form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.audit-filter-actions {
    display: flex;
    grid-column: 1 / -1;
    gap: 10px;
    margin-top: 4px;
}

.audit-results-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.audit-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.audit-timeline::before {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 24px;
    width: 2px;
    background: #dbeafe;
    content: "";
}

.audit-event-card {
    position: relative;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 15px;
}

.audit-event-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 4px solid #ffffff;
    border-radius: 16px;
    background: #eff6ff;
    font-size: 21px;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.09);
}

.audit-event-content {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.05);
}

.audit-event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.audit-event-header h3 {
    margin: 9px 0 0;
    color: #17324d;
    font-size: 15px;
    line-height: 1.5;
}

.audit-event-header time {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
}

.audit-event-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.audit-module-badge,
.audit-action-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.audit-module-badge {
    background: #f1f5f9;
    color: #475569;
}

.audit-action-create {
    background: #dcfce7;
    color: #166534;
}

.audit-action-edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.audit-action-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.audit-action-login {
    background: #ede9fe;
    color: #6d28d9;
}

.audit-action-default {
    background: #f1f5f9;
    color: #475569;
}

.audit-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}

.audit-event-meta span,
.audit-event-meta a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 9px;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    text-decoration: none;
}

.audit-event-meta strong {
    color: #334155;
}

.audit-event-meta a:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.audit-event-details {
    margin-top: 13px;
    border-top: 1px solid #eef2f7;
}

.audit-event-details summary {
    padding-top: 12px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.audit-technical-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 11px;
}

.audit-technical-grid > div {
    padding: 11px;
    border-radius: 10px;
    background: #f8fafc;
}

.audit-technical-grid span,
.audit-technical-grid strong {
    display: block;
}

.audit-technical-grid span {
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.audit-technical-grid strong {
    overflow-wrap: anywhere;
    color: #334155;
    font-size: 11px;
}

.audit-browser-detail {
    grid-column: 1 / -1;
}

.audit-pagination {
    margin-top: 22px;
}

.audit-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 40px 20px;
    text-align: center;
}

.audit-empty-state > span {
    font-size: 36px;
}

.audit-empty-state strong {
    color: #17324d;
}

.audit-empty-state p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 1250px) {
    .audit-filter-form {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .audit-search-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 950px) {
    .audit-metrics-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .audit-filter-form {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .audit-page-header,
    .audit-section-header,
    .audit-event-header {
        flex-direction: column;
    }

    .audit-metrics-grid,
    .audit-filter-form,
    .audit-technical-grid {
        grid-template-columns: 1fr;
    }

    .audit-search-field,
    .audit-browser-detail {
        grid-column: auto;
    }

    .audit-filter-actions {
        flex-direction: column;
    }

    .audit-filter-actions .btn-primary,
    .audit-filter-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .audit-timeline::before {
        display: none;
    }

    .audit-event-card {
        grid-template-columns: 1fr;
    }

    .audit-event-icon {
        display: none;
    }
}




.modern-edit-panel {
    padding: 28px;
}

.modern-edit-header {
    margin-bottom: 24px;
}

.modern-edit-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modern-edit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: #eff6ff;
    font-size: 23px;
}

.modern-edit-title h2 {
    margin: 4px 0 6px;
    color: #17324d;
}

.modern-edit-title p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.modern-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px;
}

.modern-edit-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-edit-form .form-field-full {
    grid-column: 1 / -1;
}

.modern-edit-form label {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.modern-edit-form input,
.modern-edit-form select,
.modern-edit-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.modern-edit-form textarea {
    resize: vertical;
    line-height: 1.6;
}

.modern-edit-form input:focus,
.modern-edit-form select:focus,
.modern-edit-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.modern-edit-form small {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.4;
}

.modern-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

@media (max-width: 760px) {
    .modern-edit-form {
        grid-template-columns: 1fr;
    }

    .modern-edit-form .form-field-full {
        grid-column: auto;
    }

    .modern-edit-title {
        align-items: flex-start;
    }

    .modern-edit-actions {
        flex-direction: column;
    }

    .modern-edit-actions .btn-primary,
    .modern-edit-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}







.modern-edit-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.modern-edit-page-header h1 {
    margin: 4px 0 7px;
    color: #17324d;
    font-size: 34px;
}

.modern-edit-page-header p {
    margin: 0;
    color: #64748b;
}

.patient-edit-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 19px;
    background: #ffffff;
    box-shadow: 0 9px 27px rgba(15, 23, 42, 0.06);
}

.patient-edit-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.patient-edit-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 17px;
    font-weight: 800;
}

.patient-edit-main h2 {
    margin: 4px 0 8px;
    color: #17324d;
}

.patient-edit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.patient-edit-meta span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
}

.patient-edit-meta strong {
    color: #334155;
}

.patient-edit-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(115px, 1fr));
    gap: 10px;
}

.patient-edit-stats > div {
    padding: 12px 14px;
    border-radius: 13px;
    background: #f8fafc;
}

.patient-edit-stats span,
.patient-edit-stats strong {
    display: block;
}

.patient-edit-stats span {
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.patient-edit-stats strong {
    color: #17324d;
    font-size: 14px;
}

.modern-edit-panel {
    padding: 28px;
}

.modern-edit-header {
    margin-bottom: 24px;
}

.modern-edit-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modern-edit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: #eff6ff;
    font-size: 23px;
}

.modern-edit-title h2 {
    margin: 4px 0 6px;
    color: #17324d;
}

.modern-edit-title p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.modern-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px;
}

.modern-edit-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-edit-form .form-field-full {
    grid-column: 1 / -1;
}

.modern-edit-form label {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.modern-edit-form input,
.modern-edit-form select,
.modern-edit-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
}

.modern-edit-form input:focus,
.modern-edit-form select:focus,
.modern-edit-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.modern-edit-form textarea {
    resize: vertical;
    line-height: 1.6;
}

.modern-edit-form small {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.4;
}

.existing-file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.existing-file-card > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.existing-file-card > div > span {
    font-size: 23px;
}

.existing-file-card strong,
.existing-file-card small {
    display: block;
}

.existing-file-card strong {
    color: #334155;
}

.existing-file-card small {
    margin-top: 4px;
}

.modern-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

@media (max-width: 950px) {
    .patient-edit-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .patient-edit-stats {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .modern-edit-page-header,
    .modern-edit-title,
    .existing-file-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .modern-edit-form,
    .patient-edit-stats {
        grid-template-columns: 1fr;
    }

    .modern-edit-form .form-field-full {
        grid-column: auto;
    }

    .modern-edit-actions {
        flex-direction: column;
    }

    .modern-edit-actions .btn-primary,
    .modern-edit-actions .btn-secondary,
    .modern-edit-page-header .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}






.license-live-summary {
    padding: 20px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            #f8fbff,
            #eff6ff
        );
}

.license-live-summary-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 17px;
}

.license-live-summary-header h3 {
    margin: 4px 0 0;
    color: #17324d;
    font-size: 17px;
}

.license-summary-status {
    display: inline-flex;
    align-items: center;
    min-height: 33px;
    padding: 0 11px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.license-summary-status.license-summary-active {
    background: #dcfce7;
    color: #166534;
}

.license-summary-status.license-summary-expired {
    background: #fee2e2;
    color: #b91c1c;
}

.license-summary-status.license-summary-future {
    background: #dbeafe;
    color: #1d4ed8;
}

.license-summary-status.license-summary-invalid {
    background: #ffedd5;
    color: #c2410c;
}

.license-live-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.license-live-summary-grid > div {
    padding: 14px;
    border: 1px solid rgba(191, 219, 254, 0.8);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.82);
}

.license-live-summary-grid span,
.license-live-summary-grid strong {
    display: block;
}

.license-live-summary-grid span {
    margin-bottom: 6px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.license-live-summary-grid strong {
    color: #17324d;
    font-size: 13px;
}

@media (max-width: 760px) {
    .license-live-summary-header {
        flex-direction: column;
    }

    .license-live-summary-grid {
        grid-template-columns: 1fr;
    }
}








.document-linked-badge {
    background: #ede9fe !important;
    color: #6d28d9 !important;
    font-weight: 800;
}

.document-warning-text {
    padding: 10px 12px;
    border: 1px solid #fed7aa;
    border-radius: 11px;
    background: #fff7ed;
    color: #c2410c !important;
    font-size: 11px;
    line-height: 1.5;
}

.drop-zone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}









.clinical-documents-panel {
    padding: 27px;
}

.document-library-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 18px;
}

.document-library-header h2 {
    margin: 4px 0 6px;
    color: #17324d;
}

.document-library-header p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.document-library-search {
    position: relative;
    width: min(390px, 100%);
}

.document-library-search > span {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.document-library-search input {
    width: 100%;
    min-height: 47px;
    box-sizing: border-box;
    padding: 12px 15px 12px 43px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
}

.document-library-search input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.document-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.document-filter-chip {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.document-filter-chip:hover {
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.document-filter-chip.active {
    border-color: #173b5f;
    background: #173b5f;
    color: #ffffff;
}

.clinical-document-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.clinical-document-card {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.clinical-document-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 13px 30px rgba(15, 23, 42, 0.09);
}

.clinical-document-card[hidden] {
    display: none;
}

.clinical-document-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    overflow: hidden;
    background:
        linear-gradient(
            145deg,
            #eff6ff,
            #f8fafc
        );
}

.clinical-document-preview img {
    width: 100%;
    height: 100%;
    min-height: 190px;
    object-fit: cover;
}

.clinical-document-preview > span {
    font-size: 45px;
}

.clinical-document-preview > small {
    margin-top: 9px;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.clinical-document-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px;
}

.clinical-document-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.clinical-document-heading > div {
    min-width: 0;
}

.clinical-document-heading h3 {
    overflow: hidden;
    margin: 4px 0 0;
    color: #17324d;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-linked-status {
    flex: 0 0 auto;
    padding: 6px 8px;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 9px;
    font-weight: 900;
}

.clinical-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.clinical-document-meta span {
    padding: 6px 8px;
    border-radius: 9px;
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

.clinical-document-observations {
    margin-top: 13px;
    color: #475569;
    font-size: 12px;
    line-height: 1.55;

    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    -webkit-line-clamp: 3;
}

.clinical-document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
    padding-top: 16px;
}

.document-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.document-action-button:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.document-action-danger {
    border-color: #fecaca;
    color: #b91c1c;
}

.document-action-danger:hover {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
}

.document-action-disabled {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.document-empty-search {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 42px 20px;
    text-align: center;
}

.document-empty-search[hidden] {
    display: none;
}

.document-empty-search > span {
    font-size: 36px;
}

.document-empty-search strong {
    color: #17324d;
}

.document-empty-search p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 1150px) {
    .clinical-document-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .document-library-header {
        flex-direction: column;
    }

    .document-library-search {
        width: 100%;
    }

    .clinical-document-card {
        grid-template-columns: 1fr;
    }

    .clinical-document-preview {
        min-height: 150px;
    }

    .clinical-document-preview img {
        min-height: 150px;
        max-height: 220px;
    }

    .clinical-document-heading {
        flex-direction: column;
    }
}







.finance-returning-panel {
    border: 1px solid #dbeafe;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f8fbff
        );
}

.finance-returning-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.finance-returning-card {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, 0.06);
}

.finance-returning-card-header {
    display: flex;
    align-items: center;
    gap: 13px;
}

.finance-returning-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 15px;
    font-weight: 900;
}

.finance-returning-card h3 {
    margin: 4px 0 4px;
    color: #17324d;
    font-size: 16px;
}

.finance-returning-card small {
    color: #64748b;
}

.finance-returning-stats {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 17px;
}

.finance-returning-stats > div {
    padding: 13px;
    border-radius: 13px;
    background: #f8fafc;
}

.finance-returning-stats span,
.finance-returning-stats strong {
    display: block;
}

.finance-returning-stats span {
    margin-bottom: 6px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.finance-returning-stats strong {
    color: #17324d;
    font-size: 17px;
}

.finance-returning-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 17px;
}

.finance-returning-actions .btn-primary,
.finance-returning-actions .btn-secondary {
    min-height: 36px;
    padding: 0 12px;
    font-size: 11px;
}

@media (max-width: 950px) {
    .finance-returning-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .finance-returning-stats {
        grid-template-columns: 1fr;
    }

    .finance-returning-actions {
        flex-direction: column;
    }

    .finance-returning-actions .btn-primary,
    .finance-returning-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}


/*
|--------------------------------------------------------------------------
| Sidebar NADIEL
|--------------------------------------------------------------------------
*/

:root {
    --nadiel-sidebar-width: 250px;
    --nadiel-sidebar-collapsed: 82px;
    --nadiel-navy: #17324d;
    --nadiel-navy-dark: #0d2238;
    --nadiel-gold: #d8aa45;
    --nadiel-gold-light: #f4d98d;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: var(--nadiel-sidebar-width);
    min-height: 100vh;
    overflow: hidden;
    background:
        linear-gradient(
            180deg,
            var(--nadiel-navy-dark),
            var(--nadiel-navy)
        );
    color: #ffffff;
    box-shadow:
        12px 0 32px
        rgba(15, 23, 42, 0.15);
    transition:
        width 0.25s ease,
        transform 0.25s ease;
}

.sidebar-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 17px 16px;
    border-bottom:
        1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-brand-logo {
    flex: 0 0 55px;
    width: 55px;
    height: 55px;
    object-fit: cover;
    border: 2px solid rgba(244, 217, 141, 0.75);
    border-radius: 17px;
    background: #fffaf1;
    box-shadow:
        0 8px 20px
        rgba(0, 0, 0, 0.22);
}

.sidebar-brand-copy {
    min-width: 0;
}

.sidebar-brand-copy strong,
.sidebar-brand-copy small {
    display: block;
}

.sidebar-brand-copy strong {
    color: var(--nadiel-gold-light);
    font-size: 18px;
    letter-spacing: 0.12em;
}

.sidebar-brand-copy small {
    margin-top: 4px;
    color: #cbd5e1;
    font-size: 10px;
    line-height: 1.3;
}

.sidebar-collapse-button {
    position: absolute;
    top: 50%;
    right: -11px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    transform: translateY(-50%);
    border: 1px solid rgba(216, 170, 69, 0.6);
    border-radius: 50%;
    background: #17324d;
    color: var(--nadiel-gold-light);
    font-size: 20px;
    cursor: pointer;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 15px 14px 8px;
    padding: 12px;
    border:
        1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.055);
}

.sidebar-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 39px;
    width: 39px;
    height: 39px;
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            var(--nadiel-gold-light),
            var(--nadiel-gold)
        );
    color: #17324d;
    font-weight: 900;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-info strong,
.sidebar-user-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info strong {
    font-size: 12px;
}

.sidebar-user-info small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 10px;
}

.sidebar-navigation {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 12px 20px;
}

.sidebar-section-label {
    display: block;
    margin: 18px 10px 7px;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    margin-bottom: 4px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #dbe5ef;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.sidebar-link:hover {
    transform: translateX(2px);
    border-color: rgba(216, 170, 69, 0.22);
    background: rgba(255, 255, 255, 0.075);
    color: #ffffff;
}

.sidebar-link.active {
    border-color: rgba(244, 217, 141, 0.38);
    background:
        linear-gradient(
            135deg,
            rgba(216, 170, 69, 0.23),
            rgba(216, 170, 69, 0.1)
        );
    color: #ffffff;
}

.sidebar-link.active::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -12px;
    width: 4px;
    border-radius: 0 5px 5px 0;
    background: var(--nadiel-gold);
    content: "";
}

.sidebar-link-icon,
.sidebar-link-custom-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.sidebar-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.sidebar-link-custom-icon {
    object-fit: cover;
    border-radius: 7px;
}

.sidebar-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 13px 12px calc(22px + env(safe-area-inset-bottom));
    border-top:
        1px solid rgba(255, 255, 255, 0.08);
    background: #1f3b57;
}

.sidebar-logout {
    margin-bottom: 8px;
    border-color: rgba(248, 113, 113, 0.18);
    color: #fecaca;
    touch-action: manipulation;
}

.sidebar-logout:hover {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.23);
    color: #ffffff;
}

.sidebar-version {
    display: block;
    margin-top: 10px;
    color: #64748b;
    font-size: 9px;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Sidebar contraído
|--------------------------------------------------------------------------
*/

.sidebar.sidebar-collapsed {
    width: var(--nadiel-sidebar-collapsed);
}

.sidebar.sidebar-collapsed
.sidebar-brand-copy,
.sidebar.sidebar-collapsed
.sidebar-user-info,
.sidebar.sidebar-collapsed
.sidebar-section-label,
.sidebar.sidebar-collapsed
.sidebar-link-text,
.sidebar.sidebar-collapsed
.sidebar-version {
    display: none;
}

.sidebar.sidebar-collapsed
.sidebar-brand {
    justify-content: center;
    padding-inline: 10px;
}

.sidebar.sidebar-collapsed
.sidebar-brand-logo {
    width: 49px;
    height: 49px;
    flex-basis: 49px;
}

.sidebar.sidebar-collapsed
.sidebar-user {
    justify-content: center;
    margin-inline: 10px;
    padding-inline: 8px;
}

.sidebar.sidebar-collapsed
.sidebar-link {
    justify-content: center;
    padding-inline: 8px;
}

.sidebar.sidebar-collapsed
.sidebar-collapse-button {
    transform:
        translateY(-50%)
        rotate(180deg);
}

/*
|--------------------------------------------------------------------------
| Ajuste del contenido principal
|--------------------------------------------------------------------------
*/

.main {
    margin-left: var(--nadiel-sidebar-width);
    transition: margin-left 0.25s ease;
}

body:has(.sidebar.sidebar-collapsed) .main {
    margin-left:
        var(--nadiel-sidebar-collapsed);
}

/*
|--------------------------------------------------------------------------
| Versión móvil
|--------------------------------------------------------------------------
*/

.sidebar-mobile-button {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1200;
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid #dbeafe;
    border-radius: 13px;
    background: #ffffff;
    color: #17324d;
    font-size: 21px;
    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, 0.13);
    cursor: pointer;
}

.sidebar-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.sidebar-mobile-overlay.visible {
    display: block;
}

@media (max-width: 850px) {
    .sidebar {
        width: min(280px, 86vw);
        height: 100dvh;
        min-height: 100dvh;
        padding-bottom: 0;
        overflow: hidden;
        transform: translateX(-105%);
    }

    .sidebar.sidebar-mobile-open {
        transform: translateX(0);
    }

    .sidebar-collapse-button {
        display: none;
    }

    .sidebar-mobile-button {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main,
    body:has(.sidebar.sidebar-collapsed) .main {
        margin-left: 0;
        padding-top: 72px;
    }
}



/*
|--------------------------------------------------------------------------
| Base responsiva general
|--------------------------------------------------------------------------
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

input,
select,
textarea,
button {
    max-width: 100%;
    font: inherit;
}

.main {
    width: auto;
    min-width: 0;
}

.main > * {
    min-width: 0;
}

/*
|--------------------------------------------------------------------------
| Tablas responsivas
|--------------------------------------------------------------------------
*/

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

/*
|--------------------------------------------------------------------------
| Formularios responsivos
|--------------------------------------------------------------------------
*/

.form-grid,
.filters-grid,
.dashboard-grid,
.cards-grid,
.stats-grid {
    min-width: 0;
}

input,
select,
textarea {
    width: 100%;
}

textarea {
    resize: vertical;
}

/*
|--------------------------------------------------------------------------
| Tablet
|--------------------------------------------------------------------------
*/

@media (max-width: 1024px) {
    .main {
        padding-inline: 18px;
    }

    .dashboard-grid,
    .cards-grid,
    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

/*
|--------------------------------------------------------------------------
| Celular
|--------------------------------------------------------------------------
*/

@media (max-width: 850px) {
    .main {
        width: 100%;
        padding-right: 14px;
        padding-left: 14px;
    }

    .dashboard-grid,
    .cards-grid,
    .stats-grid,
    .form-grid,
    .filters-grid {
        grid-template-columns: 1fr;
    }

    .page-header,
    .content-header,
    .section-header,
    .toolbar,
    .filters-actions,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-header button,
    .page-header a,
    .toolbar button,
    .toolbar a,
    .form-actions button,
    .form-actions a {
        width: 100%;
        text-align: center;
    }

    h1 {
        font-size: clamp(1.45rem, 7vw, 1.9rem);
    }

    h2 {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }

    table {
        font-size: 13px;
    }
}

/*
|--------------------------------------------------------------------------
| Celular pequeño
|--------------------------------------------------------------------------
*/

@media (max-width: 480px) {
    .main {
        padding-right: 10px;
        padding-left: 10px;
    }

    input,
    select,
    button {
        min-height: 44px;
    }

    .card,
    .panel,
    .content-card {
        padding: 14px;
        border-radius: 14px;
    }
}





.smart-timeline-panel {
    scroll-margin-top: 24px;
}

.smart-timeline-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 25px;
}

.smart-timeline-filter {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.smart-timeline-filter:hover {
    border-color: #d8aa45;
    color: #17324d;
}

.smart-timeline-filter.active {
    border-color: #17324d;
    background: #17324d;
    color: #ffffff;
}

.smart-clinical-timeline {
    position: relative;
}

.smart-timeline-event {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
}

.smart-timeline-event[hidden] {
    display: none;
}

.smart-timeline-axis {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.smart-timeline-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #ffffff;
    font-size: 19px;
    box-shadow:
        0 7px 20px
        rgba(15, 23, 42, 0.08);
}

.smart-timeline-line {
    width: 2px;
    min-height: 36px;
    flex: 1;
    background:
        linear-gradient(
            #dbeafe,
            #e2e8f0
        );
}

.smart-timeline-card {
    margin-bottom: 17px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #ffffff;
    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, 0.05);
}

.smart-timeline-card:hover {
    border-color: #bfdbfe;
    box-shadow:
        0 12px 28px
        rgba(15, 23, 42, 0.08);
}

.smart-timeline-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.smart-timeline-card h3 {
    margin: 4px 0 0;
    color: #17324d;
    font-size: 16px;
}

.smart-timeline-card p {
    margin: 12px 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.6;
}

.smart-timeline-status {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 9px;
    font-weight: 900;
}

.status-atencion {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-medicamento {
    background: #dcfce7;
    color: #166534;
}

.status-licencia {
    background: #fef3c7;
    color: #92400e;
}

.status-documento {
    background: #ede9fe;
    color: #6d28d9;
}

.status-pago {
    background: #e0f2fe;
    color: #075985;
}

.smart-timeline-link {
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.smart-timeline-link:hover {
    text-decoration: underline;
}

@media (max-width: 650px) {
    .smart-timeline-event {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
    }

    .smart-timeline-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 12px;
        font-size: 16px;
    }

    .smart-timeline-card-header {
        flex-direction: column;
    }
}






.patient-alert-center {
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 19px;
    background: #ffffff;
    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, 0.05);
}

.patient-alert-center-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 17px;
}

.patient-alert-center-header h2 {
    margin: 4px 0 6px;
    color: #17324d;
}

.patient-alert-center-header p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.patient-alert-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.patient-smart-alert {
    display: grid;
    grid-template-columns:
        42px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-smart-alert:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 24px
        rgba(15, 23, 42, 0.08);
}

.patient-smart-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #ffffff;
    font-size: 19px;
}

.patient-smart-alert strong {
    display: block;
    color: #17324d;
    font-size: 12px;
}

.patient-smart-alert p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

.patient-smart-alert-arrow {
    color: #94a3b8;
    font-weight: 900;
}

.patient-smart-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.patient-smart-alert-info {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.patient-smart-alert-warning {
    border-color: #fed7aa;
    background: #fff7ed;
}

.patient-smart-alert-danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.patient-smart-alert-neutral {
    border-color: #e2e8f0;
    background: #f8fafc;
}

@media (max-width: 850px) {
    .patient-alert-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .patient-alert-center-header {
        flex-direction: column;
    }

    .patient-smart-alert {
        grid-template-columns:
            38px minmax(0, 1fr);
    }

    .patient-smart-alert-arrow {
        display: none;
    }
}







/*
|--------------------------------------------------------------------------
| Dashboard del paciente
|--------------------------------------------------------------------------
*/

.patient-dashboard,
.patient-treatment-summary {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.patient-dashboard-header h2 {
    margin: 4px 0 5px;
    color: #17324d;
    font-size: 20px;
}

.patient-dashboard-header p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.patient-dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 13px;
}

.patient-dashboard-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f8fafc
        );
}

.patient-dashboard-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 45px;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #eff6ff;
    font-size: 20px;
}

.patient-dashboard-card > div:last-child {
    min-width: 0;
}

.patient-dashboard-card span,
.patient-dashboard-card strong,
.patient-dashboard-card small {
    display: block;
}

.patient-dashboard-card span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-dashboard-card strong {
    overflow: hidden;
    margin-top: 5px;
    color: #17324d;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-dashboard-card small {
    overflow: hidden;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
|--------------------------------------------------------------------------
| Tratamiento activo
|--------------------------------------------------------------------------
*/

.patient-treatment-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.patient-treatment-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
}

.patient-treatment-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #ffffff;
    font-size: 18px;
}

.patient-treatment-card strong {
    display: block;
    color: #17324d;
    font-size: 13px;
}

.patient-treatment-card p {
    margin: 5px 0 2px;
    color: #475569;
    font-size: 12px;
}

.patient-treatment-card small {
    color: #94a3b8;
    font-size: 10px;
}

@media (max-width: 1050px) {
    .patient-dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .patient-dashboard-grid,
    .patient-treatment-grid {
        grid-template-columns: 1fr;
    }

    .patient-dashboard-header {
        flex-direction: column;
    }
}





/*
|--------------------------------------------------------------------------
| Alertas inteligentes del paciente
|--------------------------------------------------------------------------
*/

.patient-alert-center {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-alert-center-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.patient-alert-center-header h2 {
    margin: 4px 0 5px;
    color: #17324d;
    font-size: 20px;
}

.patient-alert-center-header p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.patient-alert-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.patient-smart-alert {
    display: grid;
    grid-template-columns:
        44px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    color: #334155;
    text-decoration: none;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-smart-alert:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 24px
        rgba(15, 23, 42, 0.08);
}

.patient-smart-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.78);
    font-size: 20px;
}

.patient-smart-alert strong {
    display: block;
    color: #17324d;
    font-size: 12px;
}

.patient-smart-alert p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

.patient-smart-alert-arrow {
    color: #94a3b8;
    font-weight: 900;
}

.patient-smart-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.patient-smart-alert-info {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.patient-smart-alert-warning {
    border-color: #fed7aa;
    background: #fff7ed;
}

.patient-smart-alert-danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.patient-smart-alert-neutral {
    border-color: #e2e8f0;
    background: #f8fafc;
}

@media (max-width: 850px) {
    .patient-alert-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .patient-alert-center-header {
        flex-direction: column;
    }

    .patient-smart-alert {
        grid-template-columns:
            40px minmax(0, 1fr);
    }

    .patient-smart-alert-arrow {
        display: none;
    }
}





/*
|--------------------------------------------------------------------------
| Acciones rápidas del paciente
|--------------------------------------------------------------------------
*/

.patient-quick-actions {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f8fbff
        );
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-quick-actions-header {
    margin-bottom: 18px;
}

.patient-quick-actions-header h2 {
    margin: 4px 0 5px;
    color: #17324d;
    font-size: 20px;
}

.patient-quick-actions-header p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.patient-quick-actions-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.patient-quick-action {
    display: grid;
    grid-template-columns:
        45px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-quick-action:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow:
        0 10px 25px
        rgba(15, 23, 42, 0.08);
}

.patient-quick-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #eff6ff;
    font-size: 20px;
}

.patient-quick-action strong,
.patient-quick-action small {
    display: block;
}

.patient-quick-action strong {
    overflow: hidden;
    color: #17324d;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-quick-action small {
    overflow: hidden;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-quick-action-arrow {
    color: #94a3b8;
    font-weight: 900;
}

.patient-quick-action-primary {
    border-color: #bfdbfe;
    background:
        linear-gradient(
            135deg,
            #eff6ff,
            #ffffff
        );
}

.patient-quick-action-primary
.patient-quick-action-icon {
    background: #dbeafe;
}

.patient-quick-action-document {
    border-color: #fde68a;
    background:
        linear-gradient(
            135deg,
            #fffbeb,
            #ffffff
        );
}

.patient-quick-action-document
.patient-quick-action-icon {
    background: #fef3c7;
}

@media (max-width: 1100px) {
    .patient-quick-actions-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .patient-quick-actions-grid {
        grid-template-columns: 1fr;
    }
}






/*
|--------------------------------------------------------------------------
| Documentos recientes del paciente
|--------------------------------------------------------------------------
*/

.patient-recent-documents {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-recent-documents-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.patient-recent-document-card {
    display: grid;
    grid-template-columns:
        48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f8fafc
        );
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-recent-document-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow:
        0 10px 24px
        rgba(15, 23, 42, 0.07);
}

.patient-recent-document-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: #eff6ff;
    font-size: 22px;
}

.patient-recent-document-content {
    min-width: 0;
}

.patient-recent-document-content h3 {
    overflow: hidden;
    margin: 5px 0 8px;
    color: #17324d;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-recent-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.patient-recent-document-meta span {
    padding: 5px 7px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
}

.patient-recent-document-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.patient-recent-document-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    text-decoration: none;
}

.patient-recent-document-actions a:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}

@media (max-width: 900px) {
    .patient-recent-documents-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .patient-recent-document-card {
        grid-template-columns:
            44px minmax(0, 1fr);
    }

    .patient-recent-document-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
    }
}




/*
|--------------------------------------------------------------------------
| Estado Agenda en timeline
|--------------------------------------------------------------------------
*/

.smart-timeline-status.status-agenda {
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
}

.smart-timeline-event[
    data-timeline-type="agenda"
]
.smart-timeline-icon {
    background: #e0f2fe;
    box-shadow:
        0 0 0 1px #bae6fd;
}




/*
|--------------------------------------------------------------------------
| Estado clínico actual
|--------------------------------------------------------------------------
*/

.patient-current-clinical-status {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fbfdff
        );
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-current-clinical-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.patient-last-attention-date {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
}

.patient-current-clinical-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.patient-current-clinical-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #ffffff;
}

.patient-current-clinical-card-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.patient-current-clinical-card-header > span {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #eff6ff;
    font-size: 19px;
}

.patient-current-clinical-card-header small {
    display: block;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-current-clinical-card-header h3 {
    margin: 4px 0 0;
    color: #17324d;
    font-size: 14px;
}

.patient-current-clinical-text {
    margin-top: 13px;
    overflow: hidden;
    color: #475569;
    font-size: 12px;
    line-height: 1.65;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 6;
    -webkit-line-clamp: 6;
}

.patient-current-clinical-observations {
    margin-top: 13px;
    padding: 15px 17px;
    border: 1px solid #fde68a;
    border-radius: 15px;
    background: #fffbeb;
}

.patient-current-clinical-observations > span {
    color: #92400e;
    font-size: 11px;
    font-weight: 800;
}

.patient-current-clinical-observations p {
    margin: 8px 0 0;
    color: #78350f;
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 850px) {
    .patient-current-clinical-grid {
        grid-template-columns: 1fr;
    }

    .patient-current-clinical-actions {
        justify-content: flex-start;
    }
}




/*
|--------------------------------------------------------------------------
| Continuidad asistencial
|--------------------------------------------------------------------------
*/

.patient-continuity-panel {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f8fbff
        );
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-continuity-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.patient-continuity-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-continuity-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow:
        0 9px 22px
        rgba(15, 23, 42, 0.07);
}

.patient-continuity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 45px;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #eff6ff;
    font-size: 20px;
}

.patient-continuity-card > div {
    min-width: 0;
}

.patient-continuity-card small,
.patient-continuity-card strong,
.patient-continuity-card p {
    display: block;
}

.patient-continuity-card small {
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.patient-continuity-card strong {
    margin-top: 5px;
    color: #17324d;
    font-size: 17px;
}

.patient-continuity-card p {
    overflow: hidden;
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1050px) {
    .patient-continuity-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .patient-continuity-grid {
        grid-template-columns: 1fr;
    }
}





/*
|--------------------------------------------------------------------------
| Buscador de historia clínica
|--------------------------------------------------------------------------
*/

.smart-timeline-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 14px;
}

.smart-timeline-search {
    position: relative;
    flex: 1;
    max-width: 620px;
}

.smart-timeline-search > span {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.smart-timeline-search input {
    width: 100%;
    min-height: 47px;
    box-sizing: border-box;
    padding: 12px 45px 12px 44px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
}

.smart-timeline-search input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow:
        0 0 0 4px
        rgba(37, 99, 235, 0.10);
}

.smart-timeline-search button {
    position: absolute;
    top: 50%;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
}

.smart-timeline-search button:hover {
    background: #e2e8f0;
    color: #334155;
}

.smart-timeline-search button[hidden] {
    display: none;
}

.smart-timeline-results {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.smart-timeline-results strong {
    color: #17324d;
    font-size: 17px;
}

.smart-timeline-results span {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .smart-timeline-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .smart-timeline-search {
        max-width: none;
    }

    .smart-timeline-results {
        align-self: flex-start;
    }
}






/*
|--------------------------------------------------------------------------
| Diagnósticos recientes
|--------------------------------------------------------------------------
*/

.patient-diagnosis-panel {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fbfdff
        );
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-diagnosis-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.patient-diagnosis-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
}

.patient-diagnosis-search {
    position: relative;
    flex: 1;
    max-width: 580px;
}

.patient-diagnosis-search > span {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.patient-diagnosis-search input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 11px 44px 11px 42px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
}

.patient-diagnosis-search input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow:
        0 0 0 4px
        rgba(37, 99, 235, 0.1);
}

.patient-diagnosis-search button {
    position: absolute;
    top: 50%;
    right: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
}

.patient-diagnosis-search button[hidden] {
    display: none;
}

.patient-diagnosis-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 8px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
}

.patient-diagnosis-counter strong {
    color: #17324d;
    font-size: 16px;
}

.patient-diagnosis-counter span {
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
}

.patient-diagnosis-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.patient-diagnosis-item {
    display: grid;
    grid-template-columns:
        43px minmax(0, 1fr) 25px;
    align-items: flex-start;
    gap: 11px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-diagnosis-item:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow:
        0 9px 22px
        rgba(15, 23, 42, 0.07);
}

.patient-diagnosis-item[hidden] {
    display: none;
}

.patient-diagnosis-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: #eff6ff;
    font-size: 19px;
}

.patient-diagnosis-content {
    min-width: 0;
}

.patient-diagnosis-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.patient-diagnosis-meta span {
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
}

.patient-diagnosis-meta small {
    padding: 4px 7px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 8px;
    font-weight: 700;
}

.patient-diagnosis-content p {
    margin: 9px 0 0;
    overflow: hidden;
    color: #475569;
    font-size: 12px;
    line-height: 1.55;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 4;
    -webkit-line-clamp: 4;
}

.patient-diagnosis-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.patient-diagnosis-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 900px) {
    .patient-diagnosis-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .patient-diagnosis-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .patient-diagnosis-search {
        max-width: none;
    }

    .patient-diagnosis-counter {
        align-self: flex-start;
    }

    .patient-diagnosis-header-actions {
        justify-content: flex-start;
    }
}






/*
|--------------------------------------------------------------------------
| Resumen de licencias del paciente
|--------------------------------------------------------------------------
*/

.patient-license-summary-panel {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fbfdff
        );
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-license-metrics {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 16px;
}

.patient-license-metrics article {
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
}

.patient-license-metrics span,
.patient-license-metrics strong,
.patient-license-metrics small {
    display: block;
}

.patient-license-metrics span {
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-license-metrics strong {
    margin-top: 7px;
    color: #17324d;
    font-size: 20px;
}

.patient-license-metrics small {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 9px;
}

.patient-license-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.patient-license-item {
    display: grid;
    grid-template-columns:
        45px minmax(0, 1fr) 27px;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-license-item:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow:
        0 9px 22px
        rgba(15, 23, 42, 0.07);
}

.patient-license-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #eff6ff;
    font-size: 20px;
}

.patient-license-item-content {
    min-width: 0;
}

.patient-license-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.patient-license-item-header strong {
    display: block;
    color: #17324d;
    font-size: 13px;
}

.patient-license-item-header span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
}

.patient-license-status {
    flex: 0 0 auto;
    margin: 0;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.patient-license-status.is-active {
    background: #dcfce7;
    color: #166534;
}

.patient-license-status.is-finished {
    background: #f1f5f9;
    color: #64748b;
}

.patient-license-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.patient-license-dates > span {
    padding: 5px 7px;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 9px;
}

.patient-license-dates strong {
    color: #334155;
}

.patient-license-item-content > p {
    margin: 10px 0 0;
    overflow: hidden;
    color: #475569;
    font-size: 11px;
    line-height: 1.5;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    -webkit-line-clamp: 3;
}

.patient-license-item-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 900;
    text-decoration: none;
}

.patient-license-item-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 1050px) {
    .patient-license-metrics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .patient-license-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 580px) {
    .patient-license-metrics {
        grid-template-columns: 1fr;
    }

    .patient-license-item-header {
        flex-direction: column;
    }
}






/*
|--------------------------------------------------------------------------
| Resumen financiero del paciente
|--------------------------------------------------------------------------
*/

.patient-financial-summary-panel {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fbfdff
        );
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-financial-metrics {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 16px;
}

.patient-financial-metric {
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
}

.patient-financial-metric.is-paid {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.patient-financial-metric.is-pending {
    border-color: #fed7aa;
    background: #fff7ed;
}

.patient-financial-metric span,
.patient-financial-metric strong,
.patient-financial-metric small {
    display: block;
}

.patient-financial-metric span {
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-financial-metric strong {
    overflow: hidden;
    margin-top: 7px;
    color: #17324d;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-financial-metric small {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 9px;
    line-height: 1.35;
}

.patient-financial-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.patient-financial-item {
    display: grid;
    grid-template-columns:
        45px minmax(0, 1fr) 27px;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-financial-item:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow:
        0 9px 22px
        rgba(15, 23, 42, 0.07);
}

.patient-financial-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #f8fafc;
    font-size: 19px;
}

.patient-financial-item-content {
    min-width: 0;
}

.patient-financial-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.patient-financial-item-header strong {
    display: block;
    color: #17324d;
    font-size: 13px;
}

.patient-financial-item-header > div > span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
}

.patient-payment-status {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.patient-payment-status.is-paid {
    background: #dcfce7;
    color: #166534;
}

.patient-payment-status.is-pending {
    background: #ffedd5;
    color: #9a3412;
}

.patient-payment-status.is-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.patient-payment-status.is-neutral {
    background: #f1f5f9;
    color: #64748b;
}

.patient-financial-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.patient-financial-item-details > span {
    padding: 5px 7px;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 9px;
}

.patient-financial-item-details strong {
    color: #334155;
}

.patient-financial-item-content > p {
    margin: 10px 0 0;
    overflow: hidden;
    color: #64748b;
    font-size: 10px;
    line-height: 1.5;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.patient-financial-item-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 900;
    text-decoration: none;
}

.patient-financial-item-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 1200px) {
    .patient-financial-metrics {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 950px) {
    .patient-financial-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .patient-financial-metrics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .patient-financial-metrics {
        grid-template-columns: 1fr;
    }

    .patient-financial-item-header {
        flex-direction: column;
    }
}







/*
|--------------------------------------------------------------------------
| Resumen de agenda del paciente
|--------------------------------------------------------------------------
*/

.patient-agenda-summary-panel {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fbfdff
        );
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-agenda-metrics {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 16px;
}

.patient-agenda-metrics article {
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
}

.patient-agenda-metrics article.is-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.patient-agenda-metrics article.is-pending {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.patient-agenda-metrics article.is-cancelled {
    border-color: #fecaca;
    background: #fef2f2;
}

.patient-agenda-metrics article.is-absence {
    border-color: #fed7aa;
    background: #fff7ed;
}

.patient-agenda-metrics span,
.patient-agenda-metrics strong,
.patient-agenda-metrics small {
    display: block;
}

.patient-agenda-metrics span {
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-agenda-metrics strong {
    margin-top: 7px;
    color: #17324d;
    font-size: 20px;
}

.patient-agenda-metrics small {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 9px;
}

.patient-upcoming-appointments {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.patient-appointment-item {
    display: grid;
    grid-template-columns:
        58px minmax(0, 1fr) 27px;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.patient-appointment-item:hover {
    transform: translateY(-2px);
    border-color: #bae6fd;
    box-shadow:
        0 9px 22px
        rgba(15, 23, 42, 0.07);
}

.patient-appointment-date {
    padding: 8px 4px;
    border-radius: 14px;
    background: #eff6ff;
    text-align: center;
}

.patient-appointment-date strong,
.patient-appointment-date span,
.patient-appointment-date small {
    display: block;
}

.patient-appointment-date strong {
    color: #17324d;
    font-size: 21px;
}

.patient-appointment-date span {
    margin-top: 2px;
    color: #1d4ed8;
    font-size: 9px;
    font-weight: 900;
}

.patient-appointment-date small {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 9px;
}

.patient-appointment-content {
    min-width: 0;
}

.patient-appointment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.patient-appointment-header strong {
    display: block;
    color: #17324d;
    font-size: 13px;
}

.patient-appointment-header > div > span {
    display: block;
    margin-top: 4px;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
}

.patient-appointment-status {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.patient-appointment-details {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.patient-appointment-details span {
    padding: 5px 7px;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 9px;
}

.patient-appointment-content p {
    margin: 10px 0 0;
    overflow: hidden;
    color: #64748b;
    font-size: 10px;
    line-height: 1.5;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.patient-appointment-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 900;
    text-decoration: none;
}

.patient-appointment-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 1200px) {
    .patient-agenda-metrics {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 950px) {
    .patient-upcoming-appointments {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .patient-agenda-metrics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .patient-agenda-metrics {
        grid-template-columns: 1fr;
    }

    .patient-appointment-header {
        flex-direction: column;
    }
}






/*
|--------------------------------------------------------------------------
| Centro de prioridad de seguimiento
|--------------------------------------------------------------------------
*/

.patient-priority-center {
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fbfdff
        );
    box-shadow:
        0 10px 30px
        rgba(15, 23, 42, 0.06);
}

.patient-priority-center.priority-baja {
    border-color: #bbf7d0;
}

.patient-priority-center.priority-moderada {
    border-color: #fde68a;
}

.patient-priority-center.priority-alta {
    border-color: #fed7aa;
}

.patient-priority-center.priority-prioritaria {
    border-color: #fecaca;
}

.patient-priority-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.patient-priority-header h2 {
    margin: 4px 0 6px;
    color: #17324d;
    font-size: 21px;
}

.patient-priority-header p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.patient-priority-level {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
}

.patient-priority-level > span {
    font-size: 24px;
}

.patient-priority-level small,
.patient-priority-level strong {
    display: block;
}

.patient-priority-level small {
    color: #94a3b8;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.patient-priority-level strong {
    margin-top: 3px;
    color: #17324d;
    font-size: 12px;
}

.patient-priority-overview {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
}

.patient-priority-score {
    display: flex;
    align-items: center;
    gap: 18px;
}

.patient-priority-ring {
    --priority-value: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 112px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background:
        conic-gradient(
            #2563eb
            calc(var(--priority-value) * 1%),
            #e2e8f0 0
        );
}

.patient-priority-ring::before {
    position: absolute;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #ffffff;
    content: "";
}

.patient-priority-ring > div {
    position: relative;
    z-index: 1;
    text-align: center;
}

.patient-priority-ring strong {
    display: block;
    color: #17324d;
    font-size: 27px;
}

.patient-priority-ring small {
    color: #94a3b8;
    font-size: 10px;
}

.patient-priority-score-copy strong {
    color: #17324d;
    font-size: 17px;
}

.patient-priority-score-copy p {
    margin: 7px 0 6px;
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
}

.patient-priority-score-copy small {
    color: #94a3b8;
    font-size: 9px;
}

.patient-priority-progress {
    margin-top: 18px;
}

.patient-priority-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    color: #94a3b8;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-priority-progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            #bbf7d0 0 20%,
            #fde68a 20% 40%,
            #fed7aa 40% 60%,
            #fecaca 60% 100%
        );
}

.patient-priority-progress-track > span {
    display: block;
    height: 100%;
    border-right: 3px solid #17324d;
}

.patient-priority-columns {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.patient-priority-column {
    min-width: 0;
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
}

.patient-priority-column-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.patient-priority-column-header h3 {
    margin: 4px 0 0;
    color: #17324d;
    font-size: 15px;
}

.patient-priority-factor-list,
.patient-priority-protection-list {
    display: grid;
    gap: 9px;
}

.patient-priority-factor {
    display: grid;
    grid-template-columns:
        39px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid #fed7aa;
    border-radius: 13px;
    background: #fff7ed;
}

.patient-priority-factor-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    border-radius: 11px;
    background: #ffffff;
    font-size: 17px;
}

.patient-priority-factor strong,
.patient-priority-protection strong {
    display: block;
    color: #17324d;
    font-size: 11px;
}

.patient-priority-factor p,
.patient-priority-protection p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 9px;
    line-height: 1.4;
}

.patient-priority-points {
    padding: 5px 7px;
    border-radius: 8px;
    background: #ffedd5;
    color: #9a3412;
    font-size: 9px;
    font-weight: 900;
}

.patient-priority-protection {
    display: grid;
    grid-template-columns:
        39px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid #bbf7d0;
    border-radius: 13px;
    background: #f0fdf4;
}

.patient-priority-protection > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    border-radius: 11px;
    background: #ffffff;
    font-size: 17px;
}

.patient-priority-empty {
    padding: 18px;
    border-radius: 13px;
    background: #f8fafc;
    text-align: center;
}

.patient-priority-empty > span {
    font-size: 23px;
}

.patient-priority-empty p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 10px;
}

.patient-priority-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.patient-priority-footer > span {
    color: #94a3b8;
    font-size: 9px;
}

.patient-priority-footer > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 900px) {
    .patient-priority-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .patient-priority-header,
    .patient-priority-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .patient-priority-score {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .patient-priority-factor {
        grid-template-columns:
            36px minmax(0, 1fr);
    }

    .patient-priority-points {
        grid-column: 2;
        justify-self: flex-start;
    }
}







/*
|--------------------------------------------------------------------------
| Navegador interno de ficha
|--------------------------------------------------------------------------
*/

.patient-section-navigator {
    position: sticky;
    top: 12px;
    z-index: 80;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background:
        rgba(255, 255, 255, 0.94);
    box-shadow:
        0 10px 28px
        rgba(15, 23, 42, 0.09);
    backdrop-filter: blur(12px);
}

.patient-section-navigator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 11px;
}

.patient-section-navigator-header strong {
    display: block;
    margin-top: 3px;
    color: #17324d;
    font-size: 13px;
}

.patient-section-global-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.patient-section-global-actions button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 9px;
}

.patient-section-links {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
}

.patient-section-links a {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 9px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.patient-section-links a:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

/*
|--------------------------------------------------------------------------
| Secciones plegables
|--------------------------------------------------------------------------
*/

.patient-collapsible-section {
    scroll-margin-top: 130px;
}

.patient-collapsible-section
.patient-dashboard-header,
.patient-collapsible-section
.patient-alert-center-header,
.patient-collapsible-section
.patient-priority-header,
.patient-collapsible-section
.patient-quick-actions-header,
.patient-collapsible-section
.panel-header {
    position: relative;
    padding-right: 48px;
}

.patient-section-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
    color: #475569;
    font-size: 16px;
    cursor: pointer;
}

.patient-section-toggle:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.patient-collapsible-content {
    overflow: hidden;
    max-height: 20000px;
    opacity: 1;
    transition:
        max-height 0.35s ease,
        opacity 0.22s ease,
        margin 0.25s ease;
}

.patient-collapsible-section.is-collapsed
.patient-collapsible-content {
    max-height: 0;
    margin: 0;
    opacity: 0;
}

.patient-collapsible-section.is-collapsed {
    padding-bottom: 15px;
}

.patient-collapsible-section.is-collapsed
.patient-dashboard-header,
.patient-collapsible-section.is-collapsed
.patient-alert-center-header,
.patient-collapsible-section.is-collapsed
.patient-priority-header,
.patient-collapsible-section.is-collapsed
.patient-quick-actions-header,
.patient-collapsible-section.is-collapsed
.panel-header {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .patient-section-navigator {
        top: 72px;
    }

    .patient-section-navigator-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .patient-section-global-actions {
        width: 100%;
    }
}







/*
|--------------------------------------------------------------------------
| Modo de visualización de la ficha
|--------------------------------------------------------------------------
*/

.patient-view-mode-button {
    border-color: #dbeafe;
}

.patient-view-mode-button.active {
    border-color: #17324d;
    background: #17324d;
    color: #ffffff;
}

.patient-collapsible-section[hidden],
.patient-section-links a[hidden] {
    display: none !important;
}

body.patient-clinical-view
.patient-section-navigator {
    border-color: #bfdbfe;
    background:
        rgba(239, 246, 255, 0.96);
}

body.patient-clinical-view
.patient-section-navigator::before {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 9px;
    font-weight: 900;
    content: "🩺 MODO CLÍNICO ACTIVO";
}

@media (max-width: 700px) {
    .patient-section-global-actions {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .patient-section-global-actions button {
        width: 100%;
    }
}

@media (max-width: 460px) {
    .patient-section-global-actions {
        grid-template-columns: 1fr;
    }
}





/*
|--------------------------------------------------------------------------
| Alertas manuales destacadas
|--------------------------------------------------------------------------
*/

.patient-manual-alerts {
    margin-bottom: 24px;
    padding: 23px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fbfdff
        );
    box-shadow:
        0 8px 26px
        rgba(15, 23, 42, 0.05);
}

.patient-manual-alert-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.patient-manual-alert {
    display: grid;
    grid-template-columns:
        46px minmax(0, 1fr);
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #eff6ff;
}

.patient-manual-alert.priority-moderada {
    border-color: #fde68a;
    background: #fffbeb;
}

.patient-manual-alert.priority-alta {
    border-color: #fed7aa;
    background: #fff7ed;
}

.patient-manual-alert.priority-critica {
    border-color: #fecaca;
    background: #fef2f2;
}

.patient-manual-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 21px;
}

.patient-manual-alert-content {
    min-width: 0;
}

.patient-manual-alert-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.patient-manual-alert-heading small,
.patient-manual-alert-heading strong {
    display: block;
}

.patient-manual-alert-heading small {
    color: #64748b;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.patient-manual-alert-heading strong {
    margin-top: 4px;
    color: #17324d;
    font-size: 13px;
}

.patient-manual-alert-heading > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: #475569;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.patient-manual-alert.priority-critica
.patient-manual-alert-heading > span {
    color: #991b1b;
}

.patient-manual-alert.priority-alta
.patient-manual-alert-heading > span {
    color: #9a3412;
}

.patient-manual-alert.priority-moderada
.patient-manual-alert-heading > span {
    color: #92400e;
}

.patient-manual-alert-content p {
    margin: 10px 0 0;
    color: #475569;
    font-size: 11px;
    line-height: 1.55;
}

.patient-manual-alert-date {
    display: block;
    margin-top: 10px;
    color: #94a3b8;
    font-size: 8px;
}

@media (max-width: 850px) {
    .patient-manual-alert-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .patient-manual-alert-heading {
        flex-direction: column;
    }
}





.manual-alert-management-grid {
    display: grid;
    grid-template-columns:
        minmax(320px, 0.85fr)
        minmax(0, 1.35fr);
    gap: 20px;
    align-items: start;
}

.manual-alert-form-panel,
.manual-alert-list-panel {
    min-width: 0;
}

.manual-alert-form-panel {
    position: sticky;
    top: 18px;
}

.manual-alert-list {
    display: grid;
    gap: 12px;
}

.manual-alert-management-card {
    display: grid;
    grid-template-columns:
        48px minmax(0, 1fr);
    gap: 13px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 17px;
    background: #eff6ff;
}

.manual-alert-management-card.priority-moderada {
    border-color: #fde68a;
    background: #fffbeb;
}

.manual-alert-management-card.priority-alta {
    border-color: #fed7aa;
    background: #fff7ed;
}

.manual-alert-management-card.priority-critica {
    border-color: #fecaca;
    background: #fef2f2;
}

.manual-alert-management-card.is-inactive {
    border-color: #e2e8f0;
    background: #f8fafc;
    opacity: 0.72;
}

.manual-alert-management-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    font-size: 22px;
}

.manual-alert-management-content {
    min-width: 0;
}

.manual-alert-management-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.manual-alert-management-heading h3 {
    margin: 4px 0 0;
    color: #17324d;
    font-size: 14px;
}

.manual-alert-management-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.manual-alert-priority-badge,
.manual-alert-state-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #475569;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.manual-alert-state-badge.is-active {
    background: #dcfce7;
    color: #166534;
}

.manual-alert-state-badge.is-inactive {
    background: #e2e8f0;
    color: #64748b;
}

.manual-alert-management-content > p {
    margin: 11px 0 0;
    color: #475569;
    font-size: 11px;
    line-height: 1.55;
}

.manual-alert-management-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.manual-alert-management-meta span {
    padding: 5px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    color: #64748b;
    font-size: 8px;
}

.manual-alert-management-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

@media (max-width: 980px) {
    .manual-alert-management-grid {
        grid-template-columns: 1fr;
    }

    .manual-alert-form-panel {
        position: static;
    }
}

@media (max-width: 560px) {
    .manual-alert-management-heading {
        flex-direction: column;
    }

    .manual-alert-management-badges {
        justify-content: flex-start;
    }
}






/*
|--------------------------------------------------------------------------
| Edición y eliminación de alertas
|--------------------------------------------------------------------------
*/

.manual-alert-edit-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 820px);
    justify-content: center;
}

.manual-alert-edit-panel {
    min-width: 0;
}

.manual-alert-edit-information {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.manual-alert-edit-information span {
    padding: 7px 10px;
    border-radius: 9px;
    background: #ffffff;
    color: #64748b;
    font-size: 9px;
}

.manual-alert-edit-information strong {
    color: #17324d;
}

.manual-alert-delete-form {
    display: inline-flex;
    margin: 0;
}

.manual-alert-delete-button {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.manual-alert-delete-button:hover {
    transform: translateY(-1px);
}




/*
|--------------------------------------------------------------------------
| Topbar
|--------------------------------------------------------------------------
*/

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:25px;
}

.topbar-info h1{
    margin:0;
}

.topbar-info p{
    margin-top:6px;
}

.topbar-actions{
    display:flex;
    gap:10px;
    align-items:center;
}





/*
|--------------------------------------------------------------------------
| Barra de herramientas de Agenda
|--------------------------------------------------------------------------
*/

/* ==========================================================
   CABECERA AGENDA
========================================================== */

.agenda-page-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:30px;
    margin-bottom:22px;
}

.agenda-header-info h1{
    margin:0;
    font-size:42px;
    font-weight:700;
    color:#1f3555;
}

.agenda-header-info p{
    margin-top:6px;
    color:#6b7280;
}

/* ==========================================================
   BOTONES SUPERIORES
========================================================== */

.agenda-quick-actions{
    display:flex;
    gap:12px;
    align-items:center;
    flex-wrap:wrap;
}

.agenda-quick-button{
    display:flex;
    align-items:center;
    gap:12px;

    padding:12px 18px;

    border-radius:14px;

    text-decoration:none;

    transition:.25s;

    border:1px solid #dfe5ec;

    background:#fff;

    color:#243b55;

    box-shadow:0 4px 12px rgba(0,0,0,.05);
}

.agenda-quick-button:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 25px rgba(0,0,0,.08);
}

.agenda-quick-button-primary{

    background:#2563eb;
    color:white;
    border:none;

}

.agenda-quick-button-primary:hover{

    background:#1d4ed8;
    color:white;

}

.agenda-quick-icon{

    width:38px;
    height:38px;

    border-radius:10px;

    display:flex;
    justify-content:center;
    align-items:center;

    background:#edf4ff;

    font-size:18px;
    font-weight:bold;

}

.agenda-quick-button-primary
.agenda-quick-icon{

    background:white;
    color:#2563eb;

}

.agenda-quick-content{

    display:flex;
    flex-direction:column;

}

.agenda-quick-content strong{

    font-size:14px;

}

.agenda-quick-content small{

    color:#7b8794;
    font-size:12px;

}

.agenda-quick-button-primary
.agenda-quick-content small{

    color:#d9e7ff;

}

/* ==========================================================
   NUEVA DISPONIBILIDAD
========================================================== */

html{
    scroll-behavior:smooth;
}

#nueva-disponibilidad{
    scroll-margin-top:25px;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media(max-width:900px){

    .agenda-page-header{

        flex-direction:column;
        align-items:flex-start;

    }

    .agenda-quick-actions{

        width:100%;

    }

}

@media(max-width:600px){

    .agenda-quick-actions{

        flex-direction:column;

        width:100%;

    }

    .agenda-quick-button{

        width:100%;

    }

}
/*
|--------------------------------------------------------------------------
| Resaltar formulario al llegar desde la barra
|--------------------------------------------------------------------------
*/

#nueva-disponibilidad:target {
    border-color: #93c5fd;
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12),
        0 8px 24px rgba(15, 23, 42, 0.08);
}

/*
|--------------------------------------------------------------------------
| Adaptación responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 800px) {
    .agenda-toolbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .toolbar-card {
        min-height: auto;
        padding: 14px;
    }

    .toolbar-card .icono {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .toolbar-card strong {
        font-size: 14px;
    }
}






.finance-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.finance-pagination span {
    color: #64748b;
    font-size: 14px;
}

.finance-pagination strong {
    color: #1e293b;
}



@media (max-width: 850px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        height: 100dvh;
        min-height: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .sidebar-mobile-button {
        touch-action: manipulation;
    }
}




.btn-generador-agenda {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.btn-generador-agenda:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}




/* Agenda: calendario mensual y horas del día */
.agenda-layout,
.calendar-panel,
.hours-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 850px) {
    .agenda-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .calendar-panel,
    .hours-panel {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .calendar-header {
        gap: 8px;
    }

    .calendar-header h3 {
        min-width: 0;
        margin: 0;
        font-size: 18px;
        text-align: center;
    }

    .calendar-header button {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        padding: 0;
        font-size: 30px;
    }

    .calendar-weekdays,
    .calendar-days {
        width: 100%;
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .calendar-weekdays span {
        min-width: 0;
        padding: 10px 2px;
        font-size: 10px;
    }

    .calendar-day {
        display: flex;
        align-items: center;
        justify-content: center;

        width: min(38px, 100%);
        min-width: 0;
        aspect-ratio: 1;
        margin: 3px auto;
        padding: 0;

        font-size: 13px;
    }

    #dayHours {
        max-height: none;
        padding-right: 0;
    }
}





/* Login responsive en celular */
@media (max-width: 760px) {
    .modern-login-body {
        width: 100%;
        min-height: 100dvh;
        overflow-x: hidden;
    }

    .modern-login-layout {
        display: block;
        width: 100%;
        min-height: 100dvh;
    }

    .login-visual-panel {
        display: none;
    }

    .login-form-side {
        width: 100%;
        min-height: 100dvh;
        padding:
            calc(24px + env(safe-area-inset-top))
            18px
            calc(24px + env(safe-area-inset-bottom));
    }

    .login-mobile-brand {
        display: flex;
        width: min(440px, 100%);
    }

    .modern-login-card {
        width: min(440px, 100%);
        padding: 28px 22px;
        border-radius: 22px;
    }

    .modern-login-header h2 {
        font-size: 28px;
    }

    .login-input-wrapper input {
        min-height: 52px;
        font-size: 16px;
    }

    .modern-login-button {
        width: 100%;
    }

    .login-page-footer {
        text-align: center;
    }
}







/* =========================================================
   Modal Nuevo Paciente - responsive móvil
   ========================================================= */

@media (max-width: 700px) {
    .modal-paciente {
        align-items: flex-start;
        padding:
            calc(12px + env(safe-area-inset-top))
            10px
            calc(12px + env(safe-area-inset-bottom));

        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-paciente-content {
        width: 100%;
        max-width: 100%;
        max-height: none;

        margin: 0;
        padding: 22px 18px;

        border-radius: 20px;
        overflow: visible;
    }

    .modal-paciente-header {
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }

    .modal-paciente-header > div {
        min-width: 0;
        flex: 1;
    }

    .modal-paciente-header h2 {
        font-size: 25px;
        line-height: 1.15;
    }

    .modal-paciente-header p {
        margin-top: 7px;
        font-size: 15px;
        line-height: 1.4;
    }

    .modal-close {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .modal-form,
    .modal-form.form-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
    }

    .modal-form input,
    .modal-form select,
    .modal-form textarea {
        grid-column: auto;
        width: 100%;
        min-width: 0;
        min-height: 48px;

        padding: 12px 14px;

        font-size: 16px;
        border-radius: 12px;
    }

    .modal-form textarea {
        min-height: 115px;
    }

    .modal-actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        margin-top: 5px;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary,
    .modal-actions button,
    .modal-actions a {
        width: 100%;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
}



/* Corregir campo fecha dentro del modal en iPhone */
@media (max-width: 700px) {
    .modal-paciente-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .modal-form,
    .modal-form > * {
        min-width: 0;
        max-width: 100%;
    }

    .modal-form input[type="date"] {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        inline-size: 100%;
        min-inline-size: 0;
        box-sizing: border-box;
        padding-right: 14px;
        appearance: none;
        -webkit-appearance: none;
    }
}






/* Crear disponibilidad - responsive móvil */
@media (max-width: 700px) {
    #nueva-disponibilidad {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 20px 16px;
        overflow-x: hidden;
    }

    #nueva-disponibilidad .form-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    #nueva-disponibilidad .form-grid > * {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    #nueva-disponibilidad input,
    #nueva-disponibilidad select,
    #nueva-disponibilidad textarea {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        inline-size: 100% !important;
        box-sizing: border-box;
        margin: 0;
        font-size: 16px;
    }

    #nueva-disponibilidad input[type="date"],
    #nueva-disponibilidad input[type="time"] {
        -webkit-appearance: none;
        appearance: none;
    }

    #nueva-disponibilidad textarea {
        grid-column: 1 / -1;
        min-height: 120px;
    }

    #nueva-disponibilidad .btn-primary {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        text-align: center;
    }
}






/* Registrar pago - responsive iPhone */
@media (max-width: 700px) {
    .finance-form-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .finance-modern-form,
    .finance-modern-form > *,
    .finance-modern-form .form-field,
    .finance-modern-form .form-field-full {
        min-width: 0;
        max-width: 100%;
    }

    .finance-modern-form input[type="date"] {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        inline-size: 100% !important;
        min-inline-size: 0 !important;
        max-inline-size: 100% !important;

        box-sizing: border-box;
        margin: 0;
        padding-right: 14px;

        font-size: 16px;

        -webkit-appearance: none;
        appearance: none;
    }
}








/* Auditoría - filtros responsive en iPhone */
@media (max-width: 700px) {
    .audit-filters-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 20px 16px;
        overflow-x: hidden;
    }

    .audit-filter-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 14px;
    }

    .audit-filter-form > *,
    .audit-filter-form .form-field {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .audit-filter-form input,
    .audit-filter-form select {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        inline-size: 100% !important;
        min-inline-size: 0 !important;
        max-inline-size: 100% !important;

        box-sizing: border-box;
        margin: 0;
        font-size: 16px;
    }

    .audit-filter-form input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
        padding-right: 14px;
    }

    .audit-filter-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 10px;
    }

    .audit-filter-actions .btn-primary,
    .audit-filter-actions .btn-secondary,
    .audit-filter-actions button,
    .audit-filter-actions a {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        text-align: center;
    }
}









/* =========================================================
   HISTORIAL DE ATENCIONES - PANTALLAS GRANDES
   ========================================================= */

@media (min-width: 1100px) {

    .clinical-attention-sections {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        align-items: start;
    }

    /* Anamnesis ocupa todo el ancho */
    .clinical-attention-sections
    .clinical-attention-field:first-child {
        grid-column: 1 / -1;
    }

    /* Evita que diagnóstico y tratamiento se estiren */
    .clinical-attention-field {
        height: auto;
        min-height: 0;
        align-self: start;
    }

    .clinical-attention-field p {
        height: auto;
        min-height: 0;
    }
}

/* =========================================================
   ATENCIONES CLÍNICAS: HOJA, BORRADORES Y CIERRE
   ========================================================= */

.clinical-editor-panel {
    padding: 30px;
}

.clinical-editor-heading {
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.clinical-template-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 22px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 15px;
    background: #f8fbff;
}

.clinical-template-toolbar .btn-secondary {
    min-height: 48px;
    border: 0;
    cursor: pointer;
}

.clinical-sheet-form {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: clamp(20px, 4vw, 48px);
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.09);
}

.clinical-sheet-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.clinical-sheet-section {
    margin-bottom: 25px;
}

.clinical-sheet-section label {
    display: block;
    margin-bottom: 9px;
    color: #17324d;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.clinical-sheet-section textarea,
.clinical-sheet-meta input,
.clinical-template-toolbar select {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
}

.clinical-sheet-section textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.65;
}

.clinical-sheet-section textarea:focus,
.clinical-sheet-meta input:focus,
.clinical-template-toolbar select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.clinical-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 11px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
}

.clinical-sheet-actions button {
    min-height: 46px;
    border: 0;
    cursor: pointer;
}

.attention-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.attention-status-draft {
    background: #fef3c7;
    color: #92400e;
}

.attention-status-closed {
    background: #dcfce7;
    color: #166534;
}

.attention-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.attention-accordion {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.attention-accordion.is-draft {
    border-left: 5px solid #f59e0b;
}

.attention-accordion.is-closed {
    border-left: 5px solid #2563eb;
}

.attention-accordion-summary {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    min-height: 76px;
    padding: 14px 17px;
    cursor: pointer;
    list-style: none;
}

.attention-accordion-summary::-webkit-details-marker {
    display: none;
}

.attention-expand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #173b5f;
    color: #ffffff;
    font-size: 20px;
    font-weight: 400;
    transition: transform .18s ease;
}

.attention-accordion[open] .attention-expand-icon {
    transform: rotate(45deg);
}

.attention-summary-main {
    min-width: 0;
}

.attention-summary-main strong,
.attention-summary-main small {
    display: block;
}

.attention-summary-main strong {
    color: #17324d;
    font-size: 15px;
}

.attention-summary-main small {
    overflow: hidden;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attention-accordion-content {
    padding: 22px 24px 24px 68px;
    border-top: 1px solid #eef2f7;
    background: #fbfdff;
}

.attention-read-section {
    margin-bottom: 22px;
}

.attention-read-section h4 {
    margin: 0 0 9px;
    color: #17324d;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.attention-read-section > div {
    color: #334155;
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.attention-next-control {
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
}

.attention-record-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.attention-record-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #94a3b8;
    font-size: 10px;
}

.attention-record-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.attention-record-actions form {
    margin: 0;
}

.attention-record-actions button,
.attention-record-actions a {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
}

.attention-delete-button {
    padding: 0 13px;
    border-radius: 10px;
    background: #fee2e2;
    color: #b91c1c;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.attention-delete-button:hover {
    background: #fecaca;
}

@media (max-width: 760px) {
    .clinical-editor-panel {
        padding: 18px;
    }

    .clinical-template-toolbar,
    .clinical-sheet-meta {
        grid-template-columns: 1fr;
    }

    .clinical-template-toolbar .btn-secondary,
    .clinical-sheet-actions button,
    .clinical-sheet-actions .btn-secondary {
        width: 100%;
    }

    .clinical-sheet-form {
        padding: 18px 15px;
        border-radius: 12px;
        box-shadow: none;
    }

    .clinical-sheet-actions,
    .attention-record-footer,
    .attention-record-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .attention-accordion-summary {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .attention-accordion-summary .attention-status-badge {
        grid-column: 2;
        justify-self: start;
    }

    .attention-accordion-content {
        padding: 20px 16px;
    }

    .attention-record-actions a,
    .attention-record-actions button {
        width: 100%;
    }
}





/*
|--------------------------------------------------------------------------
| Paciente visible durante la redacción de atención
|--------------------------------------------------------------------------
*/

.attention-patient-sticky {
    position: sticky;
    top: 12px;
    z-index: 80;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 18px;
    padding: 13px 16px;

    border: 1px solid #bfdbfe;
    border-left: 5px solid #2563eb;
    border-radius: 15px;

    background: rgba(255, 255, 255, 0.96);

    box-shadow:
        0 10px 28px
        rgba(15, 23, 42, 0.12);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.attention-patient-sticky-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.attention-patient-sticky-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 42px;
    width: 42px;
    height: 42px;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #dbeafe,
            #e0e7ff
        );

    color: #1d4ed8;
    font-size: 14px;
    font-weight: 900;
}

.attention-patient-sticky-content {
    min-width: 0;
}

.attention-patient-sticky-content span,
.attention-patient-sticky-content strong {
    display: block;
}

.attention-patient-sticky-content span {
    margin-bottom: 3px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.attention-patient-sticky-content strong {
    overflow: hidden;
    color: #17324d;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attention-patient-sticky-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.attention-patient-sticky-meta > span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

.attention-patient-sticky-meta strong {
    color: #334155;
}

/* Tablet y celular */

@media (max-width: 850px) {
    .attention-patient-sticky {
        top: 70px;
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 12px 13px;
    }

    .attention-patient-sticky-identity {
        width: 100%;
    }

    .attention-patient-sticky-content strong {
        font-size: 15px;
    }

    .attention-patient-sticky-meta {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .attention-patient-sticky-meta > span {
        flex: 1;
        text-align: center;
    }
}









/*
|--------------------------------------------------------------------------
| Panel de recordatorios del paciente
|--------------------------------------------------------------------------
*/

.patient-reminders-board {
    position: relative;
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: linear-gradient(135deg, #fffef8, #ffffff);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.patient-reminders-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.patient-reminders-header h2 {
    margin: 5px 0 6px;
    color: #17324d;
}

.patient-reminders-header p {
    max-width: 760px;
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.patient-reminder-new-button {
    flex: 0 0 auto;
}

.patient-reminder-form {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid #dbe3ee;
    border-radius: 18px;
    background: #f8fafc;
}

.patient-reminder-form[hidden] {
    display: none;
}

.patient-reminder-form-top {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(270px, 0.6fr);
    gap: 20px;
}

.patient-reminder-text-field textarea {
    width: 100%;
    min-height: 130px;
    padding: 14px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    line-height: 1.6;
}

.patient-reminder-text-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.patient-reminder-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.patient-reminder-colors {
    margin: 0;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #ffffff;
}

.patient-reminder-colors legend {
    padding: 0 7px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.patient-reminder-color-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 7px 9px 3px 0;
    cursor: pointer;
}

.patient-reminder-color-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.patient-reminder-color-option > span {
    width: 25px;
    height: 25px;
    border: 2px solid transparent;
    border-radius: 50%;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.14);
}

.patient-reminder-color-option small {
    color: #64748b;
    font-size: 10px;
}

.patient-reminder-color-option input:checked + span {
    border-color: #17324d;
    box-shadow: 0 0 0 3px rgba(23, 50, 77, 0.12);
}

.patient-reminder-color-option.color-amarillo > span { background: #fde68a; }
.patient-reminder-color-option.color-rosado > span { background: #fbcfe8; }
.patient-reminder-color-option.color-verde > span { background: #bbf7d0; }
.patient-reminder-color-option.color-azul > span { background: #bae6fd; }
.patient-reminder-color-option.color-naranjo > span { background: #fed7aa; }
.patient-reminder-color-option.color-gris > span { background: #e2e8f0; }

.patient-reminder-pin-control {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.patient-reminder-pin-control input {
    width: 17px;
    height: 17px;
}

.patient-reminder-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.patient-reminders-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.patient-reminder-note {
    position: relative;
    min-height: 190px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px 8px 22px 8px;
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.12);
    transform: rotate(-0.35deg);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.patient-reminder-note:nth-child(even) {
    transform: rotate(0.35deg);
}

.patient-reminder-note:hover {
    z-index: 2;
    transform: translateY(-3px) rotate(0);
    box-shadow: 0 17px 32px rgba(15, 23, 42, 0.16);
}

.patient-reminder-note::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(15, 23, 42, 0.10) 51%
    );
    content: "";
}

.patient-reminder-note.color-amarillo { background: #fef3c7; }
.patient-reminder-note.color-rosado { background: #fce7f3; }
.patient-reminder-note.color-verde { background: #dcfce7; }
.patient-reminder-note.color-azul { background: #e0f2fe; }
.patient-reminder-note.color-naranjo { background: #ffedd5; }
.patient-reminder-note.color-gris { background: #f1f5f9; }

.patient-reminder-note.is-pinned {
    border-top: 5px solid rgba(23, 50, 77, 0.65);
}

.patient-reminder-note-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.patient-reminder-note-pin {
    font-size: 18px;
}

.patient-reminder-note-id {
    color: rgba(51, 65, 85, 0.65);
    font-size: 10px;
    font-weight: 800;
}

.patient-reminder-note-text {
    color: #334155;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.patient-reminder-note-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px dashed rgba(51, 65, 85, 0.22);
}

.patient-reminder-note-footer small {
    color: rgba(51, 65, 85, 0.68);
    font-size: 9px;
}

.patient-reminder-note-status {
    flex: 0 0 auto;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.48);
    color: #475569;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.patient-reminders-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 34px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 17px;
    background: #f8fafc;
    text-align: center;
}

.patient-reminders-empty > span {
    font-size: 34px;
}

.patient-reminders-empty strong {
    color: #17324d;
}

.patient-reminders-empty p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 1050px) {
    .patient-reminders-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .patient-reminders-header {
        flex-direction: column;
    }

    .patient-reminder-new-button {
        width: 100%;
    }

    .patient-reminder-form-top,
    .patient-reminders-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .patient-reminders-board {
        padding: 17px 14px;
    }

    .patient-reminder-form {
        padding: 15px;
    }

    .patient-reminder-form-actions {
        flex-direction: column;
    }

    .patient-reminder-form-actions .btn-primary,
    .patient-reminder-form-actions .btn-secondary {
        width: 100%;
    }

    .patient-reminder-note {
        min-height: 165px;
    }
}








/*
|--------------------------------------------------------------------------
| Papelitos flotantes y arrastrables
|--------------------------------------------------------------------------
*/

.floating-reminders-layer {
    position: fixed;
    inset: 0;
    z-index: 120;
    pointer-events: none;
}

.floating-reminder-note {
    position: fixed;
    width: 190px;
    min-height: 145px;
    padding: 9px 10px 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 7px 7px 18px 7px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.20);
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.floating-reminder-note:hover {
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.25);
}

.floating-reminder-note.is-dragging {
    transform: scale(1.025) rotate(0.5deg);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.30);
    cursor: grabbing;
}

.floating-reminder-note::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 22px;
    height: 22px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(15, 23, 42, 0.12) 51%
    );
    content: "";
    pointer-events: none;
}

.floating-reminder-note.color-amarillo { background: #fef3a8; }
.floating-reminder-note.color-rosado { background: #fbcfe8; }
.floating-reminder-note.color-verde { background: #bbf7d0; }
.floating-reminder-note.color-azul { background: #bae6fd; }
.floating-reminder-note.color-naranjo { background: #fed7aa; }
.floating-reminder-note.color-gris { background: #e2e8f0; }

.floating-reminder-note.is-pinned {
    outline: 2px solid rgba(245, 158, 11, 0.65);
}

.floating-reminder-handle {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    cursor: grab;
}

.floating-reminder-drag-icon {
    color: rgba(51, 65, 85, 0.48);
    font-weight: 900;
    letter-spacing: -3px;
}

.floating-reminder-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.floating-reminder-actions button {
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-size: 12px;
}

.floating-reminder-actions button:hover {
    background: rgba(255, 255, 255, 0.72);
}

.floating-reminder-text {
    display: block;
    width: 100%;
    height: 82px;
    padding: 5px 3px;
    resize: none;
    overflow-y: auto;
    border: 1px solid transparent;
    outline: none;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
    user-select: text;
}

.floating-reminder-note.is-editing
.floating-reminder-text {
    border-color: rgba(51, 65, 85, 0.25);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.34);
}

.floating-reminder-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 23px;
}

.floating-reminder-palette {
    display: flex;
    gap: 3px;
}

.floating-reminder-color-choice {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.20);
    border-radius: 50%;
    cursor: pointer;
}

.floating-reminder-color-choice.color-amarillo { background: #fde68a; }
.floating-reminder-color-choice.color-rosado { background: #f9a8d4; }
.floating-reminder-color-choice.color-verde { background: #86efac; }
.floating-reminder-color-choice.color-azul { background: #7dd3fc; }
.floating-reminder-color-choice.color-naranjo { background: #fdba74; }
.floating-reminder-color-choice.color-gris { background: #cbd5e1; }

.floating-reminder-save {
    padding: 4px 8px;
    border: 0;
    border-radius: 7px;
    background: #17324d;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.floating-reminder-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    border: 0;
    border-radius: 999px;
    background: #17324d;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    cursor: pointer;
    font-weight: 800;
}

.floating-reminder-composer {
    position: fixed;
    right: 22px;
    bottom: 78px;
    z-index: 1100;
    width: min(330px, calc(100vw - 28px));
    padding: 15px;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
}

.floating-reminder-composer[hidden] {
    display: none;
}

.floating-reminder-composer form {
    display: grid;
    gap: 11px;
}

.floating-reminder-composer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.floating-reminder-composer-header strong {
    color: #17324d;
}

.floating-reminder-composer-header button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 20px;
}

.floating-reminder-composer textarea {
    width: 100%;
    min-height: 110px;
    padding: 11px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    font-family: inherit;
}

.floating-reminder-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.floating-reminder-color-dot input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.floating-reminder-color-dot span {
    display: block;
    width: 25px;
    height: 25px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
}

.floating-reminder-color-dot input:checked + span {
    border-color: #17324d;
    box-shadow: 0 0 0 3px rgba(23, 50, 77, 0.12);
}

.floating-reminder-color-dot.color-amarillo span { background: #fde68a; }
.floating-reminder-color-dot.color-rosado span { background: #f9a8d4; }
.floating-reminder-color-dot.color-verde span { background: #86efac; }
.floating-reminder-color-dot.color-azul span { background: #7dd3fc; }
.floating-reminder-color-dot.color-naranjo span { background: #fdba74; }
.floating-reminder-color-dot.color-gris span { background: #cbd5e1; }

.floating-reminder-pin-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 850px) {
    .floating-reminder-note {
        width: 170px;
        min-height: 135px;
    }

    .floating-reminder-text {
        height: 75px;
        font-size: 11px;
    }

    .floating-reminder-fab {
        right: 14px;
        bottom: 14px;
    }

    .floating-reminder-fab span {
        display: none;
    }

    .floating-reminder-composer {
        right: 14px;
        bottom: 68px;
    }
}









/*
|--------------------------------------------------------------------------
| Corrección de visibilidad de recordatorios flotantes
|--------------------------------------------------------------------------
*/

.floating-reminders-layer {
    z-index: 5000;
}

.floating-reminder-fab {
    z-index: 5200;
}

.floating-reminder-composer {
    z-index: 5300;
}

.floating-reminder-recenter {
    position: fixed;
    right: 22px;
    bottom: 78px;
    z-index: 5200;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #17324d;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
    cursor: pointer;
    font-size: 19px;
    font-weight: 900;
}

.floating-reminder-recenter:hover {
    transform: translateY(-2px);
}

@media (max-width: 850px) {
    .floating-reminder-recenter {
        right: 14px;
        bottom: 66px;
    }
}










/*
|--------------------------------------------------------------------------
| Recordatorios flotantes redimensionables
|--------------------------------------------------------------------------
*/

.floating-reminder-note {
    min-width: 150px;
    min-height: 120px;
    max-width: min(700px, calc(100vw - 16px));
    max-height: min(700px, calc(100vh - 84px));
}

.floating-reminder-text {
    height: calc(100% - 55px);
    min-height: 55px;
}

.floating-reminder-resize-handle {
    position: absolute;
    right: 3px;
    bottom: 3px;
    z-index: 4;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 4px 4px 12px 4px;
    background:
        linear-gradient(
            135deg,
            transparent 42%,
            rgba(51, 65, 85, 0.35) 43%,
            rgba(51, 65, 85, 0.35) 52%,
            transparent 53%,
            transparent 63%,
            rgba(51, 65, 85, 0.35) 64%,
            rgba(51, 65, 85, 0.35) 73%,
            transparent 74%
        );
    cursor: nwse-resize;
    touch-action: none;
}

.floating-reminder-note.is-resizing {
    transition: none;
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.30);
}

.floating-reminder-note.is-resizing
.floating-reminder-resize-handle {
    background-color: rgba(255, 255, 255, 0.38);
}

@media (max-width: 850px) {
    .floating-reminder-resize-handle {
        width: 26px;
        height: 26px;
    }
}








/*
|--------------------------------------------------------------------------
| Dock lateral de recordatorios minimizados
|--------------------------------------------------------------------------
*/

.floating-reminder-note.is-minimized {
    display: none !important;
}

.floating-reminder-dock {
    position: fixed;
    top: 128px;
    right: 14px;
    z-index: 5250;
    width: 220px;
    max-height: calc(100vh - 170px);
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
}

.floating-reminder-dock.is-empty {
    display: none;
}

.floating-reminder-dock-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 12px 13px;
    border: 0;
    background: #17324d;
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
}

.floating-reminder-dock-toggle strong {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 11px;
}

.floating-reminder-dock-list {
    display: grid;
    gap: 7px;
    max-height: calc(100vh - 235px);
    padding: 10px;
    overflow-y: auto;
}

.floating-reminder-dock.is-collapsed
.floating-reminder-dock-list {
    display: none;
}

.floating-reminder-dock-item {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.06);
}

.floating-reminder-dock-item:hover {
    border-color: #94a3b8;
    transform: translateX(-2px);
}

.floating-reminder-dock-dot {
    width: 12px;
    height: 12px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 50%;
}

.floating-reminder-dock-label {
    overflow: hidden;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floating-reminder-dock-item.color-amarillo .floating-reminder-dock-dot { background: #fde68a; }
.floating-reminder-dock-item.color-rosado .floating-reminder-dock-dot { background: #f9a8d4; }
.floating-reminder-dock-item.color-verde .floating-reminder-dock-dot { background: #86efac; }
.floating-reminder-dock-item.color-azul .floating-reminder-dock-dot { background: #7dd3fc; }
.floating-reminder-dock-item.color-naranjo .floating-reminder-dock-dot { background: #fdba74; }
.floating-reminder-dock-item.color-gris .floating-reminder-dock-dot { background: #cbd5e1; }

@media (max-width: 850px) {
    .floating-reminder-dock {
        top: auto;
        right: 14px;
        bottom: 118px;
        width: min(250px, calc(100vw - 28px));
        max-height: 50vh;
    }

    .floating-reminder-dock-list {
        max-height: calc(50vh - 52px);
    }
}








/*
|--------------------------------------------------------------------------
| Recordatorios minimizables a punto de color
|--------------------------------------------------------------------------
*/

.floating-reminder-note.is-minimized {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 !important;
    overflow: visible;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.28);
    cursor: pointer;
}

.floating-reminder-note.is-minimized::after {
    display: none;
}

.floating-reminder-note.is-minimized .floating-reminder-handle,
.floating-reminder-note.is-minimized .floating-reminder-text,
.floating-reminder-note.is-minimized .floating-reminder-footer,
.floating-reminder-note.is-minimized .floating-reminder-resize-handle {
    display: none !important;
}

.floating-reminder-note.is-minimized .floating-reminder-minimize {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: transparent;
    cursor: pointer;
}

.floating-reminder-note.is-minimized::before {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.34);
    content: "";
    pointer-events: none;
}

.floating-reminder-minimize {
    font-weight: 900;
}

@media (max-width: 850px) {
    .floating-reminder-note.is-minimized {
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
    }
}









/*
|--------------------------------------------------------------------------
| Compartir recordatorios como pendientes
|--------------------------------------------------------------------------
*/

.share-reminder-modal {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.share-reminder-modal[hidden] {
    display: none;
}

.share-reminder-dialog {
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid #dbe3ee;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.30);
}

.share-reminder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.share-reminder-header h3 {
    margin: 5px 0 0;
    color: #17324d;
}

.share-reminder-header > button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    font-size: 22px;
}

.share-reminder-dialog form {
    display: grid;
    gap: 16px;
}

.share-reminder-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.share-reminder-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.floating-reminder-share {
    font-size: 12px;
}

@media (max-width: 700px) {
    .share-reminder-grid {
        grid-template-columns: 1fr;
    }

    .share-reminder-actions {
        flex-direction: column-reverse;
    }

    .share-reminder-actions button {
        width: 100%;
    }
}








/*
|--------------------------------------------------------------------------
| Centro de coordinación clínica
|--------------------------------------------------------------------------
*/

.coordination-center {
    margin: 28px 0;
    padding: 24px;
    border: 1px solid #dbe3ee;
    border-radius: 24px;
    background:
        linear-gradient(
            145deg,
            #f8fafc,
            #ffffff
        );
    box-shadow:
        0 14px 34px
        rgba(15, 23, 42, 0.07);
}

.coordination-center-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.coordination-center-header h2 {
    margin: 5px 0 7px;
    color: #17324d;
}

.coordination-center-header p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.coordination-counter-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(105px, 1fr));
    gap: 10px;
}

.coordination-counter {
    min-width: 110px;
    padding: 11px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    text-align: center;
}

.coordination-counter span {
    display: block;
    color: #64748b;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.coordination-counter strong {
    display: block;
    margin-top: 3px;
    color: #17324d;
    font-size: 23px;
}

.counter-pending {
    border-top: 4px solid #f59e0b;
}

.counter-progress {
    border-top: 4px solid #3b82f6;
}

.counter-completed {
    border-top: 4px solid #22c55e;
}

.coordination-kanban {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.coordination-column {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
}

.coordination-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 15px;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.84);
}

.coordination-column-header > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coordination-column-header h3 {
    margin: 0;
    color: #334155;
    font-size: 14px;
}

.coordination-column-header > strong {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
}

.coordination-column-pending {
    border-top: 4px solid #f59e0b;
}

.coordination-column-progress {
    border-top: 4px solid #3b82f6;
}

.coordination-column-completed {
    border-top: 4px solid #22c55e;
}

.coordination-task-list {
    display: grid;
    gap: 11px;
    max-height: 630px;
    padding: 12px;
    overflow-y: auto;
}

.coordination-task-card {
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #94a3b8;
    border-radius: 14px;
    background: #ffffff;
    box-shadow:
        0 6px 15px
        rgba(15, 23, 42, 0.06);
}

.coordination-task-card.priority-baja {
    border-left-color: #94a3b8;
}

.coordination-task-card.priority-normal {
    border-left-color: #3b82f6;
}

.coordination-task-card.priority-alta {
    border-left-color: #f59e0b;
}

.coordination-task-card.priority-urgente {
    border-left-color: #ef4444;
}

.coordination-task-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.coordination-priority-badge {
    padding: 5px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.priority-urgente
.coordination-priority-badge {
    background: #fee2e2;
    color: #b91c1c;
}

.priority-alta
.coordination-priority-badge {
    background: #fef3c7;
    color: #92400e;
}

.coordination-task-id {
    color: #94a3b8;
    font-size: 9px;
    font-weight: 800;
}

.coordination-task-card h4 {
    margin: 0 0 8px;
    color: #17324d;
    font-size: 14px;
    line-height: 1.4;
}

.coordination-task-description {
    display: -webkit-box;

    margin: 0 0 12px;

    overflow: hidden;

    color: #64748b;

    font-size: 11px;
    line-height: 1.55;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.coordination-task-meta {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 10px;
}

.coordination-patient-link {
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
}

.coordination-patient-link:hover {
    text-decoration: underline;
}

.coordination-task-meta .is-overdue {
    color: #dc2626;
    font-weight: 900;
}

.coordination-task-meta .is-today {
    color: #d97706;
    font-weight: 900;
}

.coordination-task-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.coordination-task-actions form {
    margin: 0;
}

.coordination-action-link,
.coordination-action-button {
    padding: 7px 9px;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 850;
    text-decoration: none;
}

.coordination-action-link {
    background: #f1f5f9;
    color: #475569;
}

.coordination-action-button {
    background: #17324d;
    color: #ffffff;
}

.coordination-complete-button {
    background: #15803d;
}

.coordination-completed-by {
    color: #15803d;
    font-size: 9px;
    font-weight: 800;
}

.coordination-empty-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 35px 15px;
    color: #94a3b8;
    text-align: center;
}

.coordination-empty-column > span {
    font-size: 28px;
}

.coordination-empty-column strong {
    color: #64748b;
    font-size: 12px;
}

.coordination-empty-column small {
    font-size: 9px;
}

@media (max-width: 1100px) {
    .coordination-center-header {
        flex-direction: column;
    }

    .coordination-counter-grid {
        width: 100%;
    }

    .coordination-kanban {
        grid-template-columns: 1fr;
    }

    .coordination-task-list {
        max-height: none;
    }
}

@media (max-width: 600px) {
    .coordination-center {
        padding: 17px 13px;
    }

    .coordination-counter-grid {
        grid-template-columns: 1fr;
    }

    .coordination-task-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .coordination-task-actions form,
    .coordination-action-link,
    .coordination-action-button {
        width: 100%;
    }

    .coordination-action-link,
    .coordination-action-button {
        display: block;
        text-align: center;
    }
}










/*
|--------------------------------------------------------------------------
| Archivo automático de pendientes completados
|--------------------------------------------------------------------------
*/

.coordination-header-actions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.coordination-archive-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    color: #475569;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.06);
    font-size: 11px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.coordination-archive-link strong {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 10px;
}

.coordination-archive-link:hover {
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.archived-tasks-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.archived-tasks-header h1 {
    margin: 5px 0 7px;
}

.archived-tasks-header p {
    margin: 0;
    color: #64748b;
}

.archived-tasks-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 15px 17px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
}

.archived-tasks-summary span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.archived-tasks-summary strong {
    color: #17324d;
    font-size: 26px;
}

.archived-tasks-summary p {
    margin: 0;
    color: #64748b;
    font-size: 11px;
}

.archived-tasks-list {
    display: grid;
    gap: 13px;
}

.archived-task-card {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #64748b;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.archived-task-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.archived-task-heading h3 {
    margin: 8px 0 0;
    color: #17324d;
    font-size: 15px;
}

.archived-task-id {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
}

.archived-task-card > p {
    margin: 12px 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}

.archived-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    color: #64748b;
    font-size: 10px;
}

.archived-task-meta a {
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 1100px) {
    .coordination-header-actions {
        width: 100%;
        flex-direction: column;
    }

    .coordination-archive-link,
    .coordination-counter-grid {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .archived-tasks-header,
    .archived-tasks-summary {
        align-items: stretch;
        flex-direction: column;
    }
}








/* =========================================================
   CENTRO DE SEGURIDAD
   ========================================================= */

.security-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.security-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.security-page-header h1 {
    margin: 5px 0 8px;
}

.security-page-header p {
    margin: 0;
    max-width: 720px;
    color: #64748b;
    line-height: 1.6;
}

.security-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    padding: 10px 15px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 13px;
    font-weight: 700;
}

.security-status-badge span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.security-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.security-summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.security-summary-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 15px;
    background: #eff6ff;
    font-size: 24px;
}

.security-summary-card div:last-child {
    min-width: 0;
}

.security-summary-card span,
.security-summary-card small {
    display: block;
}

.security-summary-card span {
    color: #64748b;
    font-size: 13px;
}

.security-summary-card strong {
    display: block;
    margin: 4px 0;
    color: #17324d;
    font-size: 22px;
}

.security-summary-card small {
    color: #94a3b8;
    line-height: 1.4;
}

.security-passkeys-panel {
    padding: 28px;
}

.security-section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e2e8f0;
}

.security-section-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 16px;
    background: #eef2ff;
    font-size: 25px;
}

.security-section-header h2 {
    margin: 4px 0 7px;
}

.security-section-header p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

.security-empty-state {
    padding: 42px 20px 28px;
    text-align: center;
}

.security-empty-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 17px;
    border-radius: 22px;
    background: #f1f5f9;
    font-size: 32px;
}

.security-empty-state h3 {
    margin: 0 0 9px;
    color: #17324d;
}

.security-empty-state p {
    max-width: 480px;
    margin: 0 auto;
    color: #64748b;
    line-height: 1.6;
}

.security-passkey-list {
    display: grid;
    gap: 12px;
    padding: 24px 0 8px;
}

.security-passkey-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #f8fafc;
}

.security-passkey-device-icon {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 13px;
    background: #ffffff;
    font-size: 21px;
}

.security-passkey-info {
    flex: 1;
    min-width: 0;
}

.security-passkey-info strong,
.security-passkey-info span,
.security-passkey-info small {
    display: block;
}

.security-passkey-info strong {
    color: #17324d;
}

.security-passkey-info span,
.security-passkey-info small {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
}

.security-passkey-active,
.security-enabled,
.security-coming-soon {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.security-passkey-active,
.security-enabled {
    background: #dcfce7;
    color: #166534;
}

.security-coming-soon {
    background: #f1f5f9;
    color: #475569;
}

.security-passkey-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    padding-top: 14px;
}

.security-register-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding-inline: 22px;
}

.security-passkey-actions p {
    margin: 0;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
}

.security-options-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.security-option-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 22px;
}

.security-option-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #f1f5f9;
    font-size: 22px;
}

.security-option-card h3 {
    margin: 0 0 7px;
    color: #17324d;
}

.security-option-card p {
    margin: 0 0 13px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.security-option-link {
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.security-option-link:hover {
    text-decoration: underline;
}

@media (max-width: 1000px) {
    .security-summary-grid,
    .security-options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .security-page-header {
        flex-direction: column;
    }

    .security-passkeys-panel {
        padding: 20px;
    }

    .security-section-header {
        flex-direction: column;
    }

    .security-passkey-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .security-passkey-active {
        margin-left: 60px;
    }

    .security-register-button {
        width: 100%;
    }
}






/* =========================================================
   LOGIN MEDIANTE PASSKEY
   ========================================================= */

.login-method-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 16px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-method-divider::before,
.login-method-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.login-method-divider span {
    white-space: nowrap;
}

.login-passkey-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #ffffff;
    color: #17324d;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.login-passkey-button:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.1);
}

.login-passkey-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.18);
    outline-offset: 2px;
}

.login-passkey-button:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

.passkey-login-status {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 11px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.passkey-login-status.login-alert {
    background: #fef2f2;
    color: #991b1b;
}






/* =========================================================
   ADMINISTRACIÓN DE PASSKEYS
   ========================================================= */

.security-passkey-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.security-passkey-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.security-passkey-action {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.security-passkey-action:hover {
    border-color: #2563eb;
    color: #1d4ed8;
    background: #eff6ff;
}

.security-passkey-action-danger:hover {
    border-color: #fca5a5;
    color: #b91c1c;
    background: #fef2f2;
}

.security-passkey-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

.security-modal[hidden] {
    display: none;
}

.security-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.security-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
}

.security-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    padding: 25px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.security-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.security-modal-header h2 {
    margin: 4px 0 0;
}

.security-modal-close {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.security-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

body.security-modal-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .security-passkey-side {
        width: 100%;
        align-items: stretch;
        padding-left: 60px;
    }

    .security-passkey-controls {
        justify-content: flex-start;
    }

    .security-passkey-action {
        flex: 1;
    }

    .security-modal-actions {
        flex-direction: column-reverse;
    }

    .security-modal-actions .btn-primary,
    .security-modal-actions .btn-secondary {
        width: 100%;
    }
}






/* =========================================================
   SESIONES ACTIVAS
   ========================================================= */

.security-sessions-panel {
    padding: 28px;
}

.security-session-list {
    display: grid;
    gap: 13px;
    padding-top: 24px;
}

.security-session-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.security-session-current {
    border-color: #93c5fd;
    background: #eff6ff;
}

.security-session-device-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #ffffff;
    font-size: 23px;
}

.security-session-info {
    flex: 1;
    min-width: 0;
}

.security-session-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.security-session-info strong,
.security-session-info span,
.security-session-info small {
    display: block;
}

.security-session-info strong {
    color: #17324d;
}

.security-session-info span {
    margin-top: 4px;
    color: #475569;
    font-size: 13px;
}

.security-session-info small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 12px;
    word-break: break-word;
}

.security-session-current-badge {
    display: inline-flex !important;
    width: max-content;
    margin-top: 0 !important;
    padding: 5px 9px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8 !important;
    font-size: 10px !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.security-session-actions {
    flex-shrink: 0;
}

.security-session-revoke {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #ffffff;
    color: #b91c1c;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.security-session-revoke:hover {
    border-color: #f87171;
    background: #fef2f2;
}

.security-session-revoke:disabled {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 700px) {
    .security-sessions-panel {
        padding: 20px;
    }

    .security-session-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .security-session-info {
        width: calc(100% - 63px);
    }

    .security-session-actions {
        width: 100%;
        padding-left: 63px;
    }

    .security-session-revoke {
        width: 100%;
    }
}








/* =========================================================
   HISTORIAL DE ACCESOS
   ========================================================= */

.security-history-panel {
    padding: 28px;
}

.security-history-list {
    display: grid;
    gap: 12px;
    padding-top: 24px;
}

.security-history-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #ffffff;
}

.security-history-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 17px;
}

.security-history-info {
    flex: 1;
    min-width: 0;
}

.security-history-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.security-history-info strong {
    color: #17324d;
}

.security-history-info > span {
    display: block;
    margin-top: 5px;
    color: #475569;
    font-size: 13px;
}

.security-history-info small {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 12px;
    word-break: break-word;
}

.security-history-status {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.security-history-status-activa {
    background: #dcfce7;
    color: #166534;
}

.security-history-status-cerrada {
    background: #f1f5f9;
    color: #475569;
}

.security-history-status-revocada {
    background: #fee2e2;
    color: #b91c1c;
}

.security-history-status-expirada {
    background: #ffedd5;
    color: #c2410c;
}

@media (max-width: 700px) {
    .security-history-panel {
        padding: 20px;
    }

    .security-history-item {
        padding: 15px;
    }
}



/* =========================================================
   QR LOGIN · BOTÓN Y MODAL
   ========================================================= */

.login-qr-divider {
    margin-top: 18px;
}

.login-qr-button {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    background: #eff6ff;
    color: #17324d;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.login-qr-button:hover {
    border-color: #60a5fa;
    background: #dbeafe;
    box-shadow:
        0 8px 20px
        rgba(37, 99, 235, 0.10);
    transform: translateY(-1px);
}

.login-qr-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.22);
    outline-offset: 2px;
}

.login-qr-button:disabled {
    cursor: wait;
    opacity: 0.65;
    box-shadow: none;
    transform: none;
}

/* =========================================================
   ESTADO DEL DOCUMENTO
   ========================================================= */

body.qr-modal-open {
    overflow: hidden;
}

/* =========================================================
   CONTENEDOR GENERAL DEL MODAL
   ========================================================= */

.qr-login-modal[hidden] {
    display: none;
}

.qr-login-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
}

/* =========================================================
   FONDO OSCURO
   ========================================================= */

.qr-login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* =========================================================
   TARJETA DEL MODAL
   ========================================================= */

.qr-login-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 680px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    background: #ffffff;
    box-shadow:
        0 30px 90px rgba(15, 23, 42, 0.32);

    animation:
        qrLoginModalEntrada
        0.22s ease-out;
}

@keyframes qrLoginModalEntrada {
    from {
        opacity: 0;
        transform:
            translateY(16px)
            scale(0.98);
    }

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

/* =========================================================
   CABECERA
   ========================================================= */

.qr-login-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.qr-login-panel-header h3 {
    margin: 5px 0 7px;
    color: #17324d;
    font-size: 23px;
    line-height: 1.25;
}

.qr-login-panel-header p {
    max-width: 500px;
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.qr-login-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #eef2f7;
    color: #64748b;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.qr-login-close:hover {
    background: #e2e8f0;
    color: #17324d;
    transform: rotate(4deg);
}

.qr-login-close:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.22);
    outline-offset: 2px;
}

/* =========================================================
   CONTENIDO INTERNO
   ========================================================= */

.qr-login-modal-content {
    display: grid;
    grid-template-columns:
        230px
        minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

/* =========================================================
   IMAGEN QR
   ========================================================= */

.qr-login-image-wrapper {
    position: relative;
    width: 230px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 18px;
    background: #ffffff;
    box-shadow:
        0 14px 34px
        rgba(15, 23, 42, 0.11);
}

.qr-login-image {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    padding: 8px;
    object-fit: contain;
    background: #ffffff;
}

.qr-login-image:not([src]) {
    display: none;
}

.qr-login-loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #64748b;
    font-size: 27px;
}

.qr-login-loader span {
    animation:
        qrLoginLoaderPulso
        1.1s ease-in-out infinite;
}

@keyframes qrLoginLoaderPulso {
    0%,
    100% {
        opacity: 0.45;
        transform: scale(0.94);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================================
   INFORMACIÓN LATERAL
   ========================================================= */

.qr-login-modal-details {
    min-width: 0;
}

.qr-login-status {
    margin: 0;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
}

.qr-login-status-error {
    color: #b91c1c;
}

.qr-login-status-success {
    color: #15803d;
}

.qr-login-countdown {
    min-height: 20px;
    margin: 7px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   BOTÓN DE RENOVACIÓN
   ========================================================= */

.qr-login-refresh-button {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    padding: 9px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.qr-login-refresh-button:hover {
    border-color: #60a5fa;
    background: #eff6ff;
    color: #1d4ed8;
}

.qr-login-refresh-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.22);
    outline-offset: 2px;
}

/* =========================================================
   INSTRUCCIONES
   ========================================================= */

.qr-login-instructions {
    display: grid;
    grid-template-columns:
        27px
        minmax(0, 1fr);
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.qr-login-instructions > span {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
}

.qr-login-instructions p {
    align-self: center;
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

/* =========================================================
   AVISO DE SEGURIDAD
   ========================================================= */

.qr-login-warning {
    margin-top: 17px;
    padding: 11px 13px;
    border: 1px solid #fed7aa;
    border-radius: 11px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 680px) {
    .qr-login-modal {
        align-items: end;
        padding: 12px;
    }

    .qr-login-modal-card {
        width: 100%;
        max-height: calc(100dvh - 24px);
        padding: 20px;
        border-radius: 22px;
    }

    .qr-login-panel-header {
        margin-bottom: 18px;
    }

    .qr-login-panel-header h3 {
        font-size: 20px;
    }

    .qr-login-modal-content {
        grid-template-columns: 1fr;
        gap: 19px;
    }

    .qr-login-image-wrapper {
        width: min(100%, 220px);
        margin: 0 auto;
    }

    .qr-login-status,
    .qr-login-countdown {
        text-align: center;
    }

    .qr-login-warning {
        text-align: center;
    }
}

@media (max-width: 420px) {
    .qr-login-modal {
        padding: 8px;
    }

    .qr-login-modal-card {
        max-height: calc(100dvh - 16px);
        padding: 17px;
        border-radius: 19px;
    }

    .qr-login-image-wrapper {
        width: min(100%, 195px);
    }

    .qr-login-panel-header h3 {
        font-size: 18px;
    }

    .qr-login-panel-header p {
        font-size: 12px;
    }
}





/* =========================================================
   BÚSQUEDA GLOBAL
   ========================================================= */

.sidebar-global-search {
    position: relative;
    padding: 6px 14px 14px;
    z-index: 80;
}

.sidebar-global-search-form {
    position: relative;
}

.sidebar-global-search-control {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-global-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    opacity: .72;
}

.sidebar-global-search-input {
    width: 100%;
    min-width: 0;
    height: 42px;

    padding: 0 38px 0 38px;

    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;

    background: rgba(255, 255, 255, .08);
    color: #ffffff;

    font: inherit;
    font-size: 13px;

    outline: none;

    transition:
        background .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

.sidebar-global-search-input::placeholder {
    color: rgba(255, 255, 255, .62);
}

.sidebar-global-search-input:focus {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .30);

    box-shadow:
        0 0 0 3px
        rgba(255, 255, 255, .06);
}

.sidebar-global-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);

    width: 28px;
    height: 28px;

    padding: 0;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: rgba(255, 255, 255, .7);

    font-size: 20px;
    line-height: 1;

    cursor: pointer;
}

.sidebar-global-search-clear:hover {
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
}

/* =========================================================
   PANEL DE RESULTADOS
   ========================================================= */

.sidebar-global-search-results {
    position: fixed;

    width: 420px;
    max-width: calc(100vw - 280px);
    max-height: 520px;

    overflow-x: hidden;
    overflow-y: auto;

    background: #ffffff;

    border: 1px solid #dbe4ee;
    border-radius: 16px;

    box-shadow:
        0 20px 50px
        rgba(15, 23, 42, .20);

    z-index: 999999;
}

.global-search-result {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 13px 15px;

    color: #334155;
    text-decoration: none;

    border-bottom: 1px solid #edf2f7;

    transition:
        background .15s ease,
        transform .15s ease;
}

.global-search-result:last-child {
    border-bottom: 0;
}

.global-search-result:hover {
    background: #f7f9fc;
}

.global-search-result-icon {
    flex: 0 0 32px;

    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #eef4f9;

    font-size: 16px;
}

.global-search-result-body {
    display: flex;
    flex: 1;
    min-width: 0;

    flex-direction: column;

    overflow: hidden;
}

.global-search-result-top {
    display: flex;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 3px;
}

.global-search-result-type {
    color: #64748b;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .06em;
    text-transform: uppercase;
}

.global-search-result-date {
    color: #94a3b8;

    font-size: 10px;

    white-space: nowrap;
}

.global-search-result-title {
    display: block;

    color: #17324d;

    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-result-patient {
    display: block;

    margin-top: 3px;

    color: #475569;

    font-size: 12px;
    line-height: 1.35;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-result-fragment {
    display: -webkit-box;

    margin-top: 5px;

    color: #64748b;

    font-size: 11px;
    line-height: 1.45;

    -webkit-line-clamp: 2;
    line-clamp: 2;

    -webkit-box-orient: vertical;

    overflow: hidden;
    overflow-wrap: anywhere;
}

.global-search-empty {
    padding: 18px 16px;

    color: #64748b;

    font-size: 12px;
    line-height: 1.5;

    text-align: center;
}

/* =========================================================
   RESALTADO DE PALABRAS EN RESULTADOS
   ========================================================= */

.global-search-highlight {
    display: inline;

    padding: 1px 2px;

    border-radius: 4px;

    background: rgba(255, 207, 64, .38);

    color: inherit;

    font-weight: 800;

    box-shadow:
        0 1px 4px
        rgba(180, 125, 0, .15);
}

/* =========================================================
   RESALTADO DENTRO DE ATENCIONES
   ========================================================= */

.attention-search-highlight {
    display: inline;

    padding: 1px 3px;

    border-radius: 4px;

    background: rgba(255, 207, 64, .45);

    color: inherit;

    font-weight: 700;

    box-shadow:
        0 1px 4px
        rgba(180, 125, 0, .14);
}

/* =========================================================
   SIDEBAR CONTRAÍDO
   ========================================================= */

body.sidebar-collapsed
.sidebar-global-search {
    display: none;
}

/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 850px) {

    .sidebar-global-search-results {
        position: fixed;

        top: 150px !important;
        left: 16px !important;
        right: 16px !important;

        width: auto !important;
        max-width: none;

        max-height:
            calc(100dvh - 180px);
    }

}





/* ==========================================================
   FICHA DEL PACIENTE / MÓDULOS - CORRECCIÓN MÓVIL
   Agenda · Pagos · Licencias · Boletas
   ========================================================== */

@media (max-width: 850px) {

    /* ------------------------------------------------------
       Evitar que los módulos ensanchen toda la página
       ------------------------------------------------------ */

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .main {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .main > *,
    .patient-module-header,
    .patient-module-navigation,
    .patient-module-section,
    .module-context-alert,
    .panel {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }


    /* ------------------------------------------------------
       Cabecera PACIENTE ACTIVO
       ------------------------------------------------------ */

    .patient-module-header {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
    }

    .patient-module-identity {
        width: 100%;
        min-width: 0;
        align-items: flex-start;
        gap: 12px;
    }

    .patient-module-identity > div:last-child {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .patient-avatar-small {
        flex: 0 0 52px;
        width: 52px;
        height: 52px;
        border-radius: 16px;
        font-size: 18px;
    }

    .patient-module-header h1 {
        width: 100%;
        max-width: 100%;
        margin: 3px 0 10px;
        font-size: clamp(20px, 5.6vw, 26px);
        line-height: 1.18;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .patient-profile-meta {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .patient-profile-meta span {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        text-align: center;
        white-space: normal;
    }


    /* ------------------------------------------------------
       Navegación Resumen / Atenciones / Medicamentos...
       SOLO ella puede desplazarse horizontalmente
       ------------------------------------------------------ */

    .patient-module-navigation {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 7px;
        padding: 7px;
        margin-bottom: 20px;

        overflow-x: auto;
        overflow-y: hidden;

        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }

    .patient-module-tab {
        flex: 0 0 auto;
        min-width: max-content;
        white-space: nowrap;
    }


    /* ------------------------------------------------------
       Tarjeta contextual:
       PACIENTE ACTIVO · AGENDA / PAGOS / LICENCIAS...
       ------------------------------------------------------ */

    .module-context-alert {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;

        display: flex;
        align-items: flex-start;
        gap: 12px;

        margin-left: 0;
        margin-right: 0;

        padding: 15px;
    }

    .module-context-alert > div:last-child {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .module-context-alert strong,
    .module-context-alert p {
        max-width: 100%;
        overflow-wrap: anywhere;
    }


    /* ------------------------------------------------------
       Paneles
       ------------------------------------------------------ */

    .patient-module-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 16px;
        margin-left: 0;
        margin-right: 0;
        overflow: hidden;
    }

    .patient-module-title {
        width: 100%;
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .patient-module-title-content {
        width: 100%;
        min-width: 0;
        align-items: flex-start;
    }

    .patient-module-title-content > div:last-child {
        min-width: 0;
    }

    .patient-module-title h2,
    .patient-module-title p {
        max-width: 100%;
        overflow-wrap: anywhere;
    }


    /* ------------------------------------------------------
       Formularios: una sola columna
       Especialmente Licencias y Boletas
       ------------------------------------------------------ */

    .modern-clinical-form,
    .form-grid,
    .filters-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .modern-clinical-form > *,
    .form-grid > *,
    .filters-grid > * {
        min-width: 0;
        max-width: 100%;
        grid-column: auto !important;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
        box-sizing: border-box;
    }


    /* ------------------------------------------------------
       Métricas / tarjetas financieras
       ------------------------------------------------------ */

    .stats-grid,
    .dashboard-grid,
    .cards-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .stats-grid > *,
    .dashboard-grid > *,
    .cards-grid > * {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }


    /* ------------------------------------------------------
       TABLAS
       La página NO hace scroll horizontal.
       Solo la caja de la tabla.
       ------------------------------------------------------ */

    .table-responsive,
    .agenda-table-wrapper,
    .licenses-table-wrapper {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;

        overflow-x: auto;
        overflow-y: hidden;

        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .table-responsive table,
    .agenda-table-wrapper table,
    .licenses-table-wrapper table {
        width: max-content;
        min-width: 680px;
        max-width: none;
    }


    /* ------------------------------------------------------
       Tarjetas de registros
       ------------------------------------------------------ */

    .patient-record-grid {
        width: 100%;
        max-width: 100%;
        grid-template-columns: minmax(0, 1fr);
    }

    .patient-record-card,
    .patient-record-row {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .patient-record-row {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* ==========================================================
   TELÉFONOS PEQUEÑOS
   ========================================================== */

@media (max-width: 520px) {

    .main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .patient-profile-meta {
        grid-template-columns: 1fr;
    }

    .patient-module-section {
        padding: 14px;
        border-radius: 16px;
    }

    .patient-module-header h1 {
        font-size: 21px;
    }

    .patient-module-tab {
        min-height: 42px;
        padding: 9px 12px;
        font-size: 13px;
    }

    .module-context-alert {
        padding: 14px;
    }
}





/* ==========================================================
   MÓDULO LICENCIAS - RESPONSIVE
   ========================================================== */

.license-form {
    min-width: 0;
}

.license-form-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 8px;
}

.license-form-field label {
    color: #334155;
    font-weight: 600;
}

.license-form-field input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.license-history-table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.license-history-table table {
    width: max-content;
    min-width: 720px;
    max-width: none;
}


/* ----------------------------------------------------------
   Móvil
   ---------------------------------------------------------- */

@media (max-width: 850px) {

    .license-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 16px;
    }

    .license-form > *,
    .license-form-field {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        grid-column: 1 / -1 !important;
    }

    .license-form-field input,
    .license-form input,
    .license-form textarea,
    .license-form select {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .license-form input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
    }

    .license-form .drop-zone {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .license-history-table {
        margin-top: 14px;
        border-radius: 12px;
    }

    .license-history-table table {
        width: max-content !important;
        min-width: 720px !important;
    }

    .license-history-table th,
    .license-history-table td {
        white-space: nowrap;
    }

    .license-history-table td:nth-child(4) {
        min-width: 180px;
        white-space: normal;
    }

    .license-form .btn-primary {
    width: 100%;
    justify-content: center;
    text-align: center;
}
}

/* ==========================================================
   CERTIFICADOS / DOCUMENTOS - RESPONSIVE
   ========================================================== */

.certificate-upload-form {
    min-width: 0;
}

.certificate-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.certificate-form-field input,
.certificate-form-field select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}


/* ==========================================================
   TARJETA PACIENTE ACTIVO - MÓVIL
   ========================================================== */

@media (max-width: 850px) {

    .attention-patient-sticky {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow: hidden;
    }

    .attention-patient-sticky-identity {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .attention-patient-sticky-content {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }

    .attention-patient-sticky-content strong {
        display: block;
        width: 100%;
        max-width: 100%;

        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;

        font-size: clamp(19px, 5vw, 25px);
        line-height: 1.2;
    }

    .attention-patient-sticky-meta {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .certificate-upload-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 16px;
    }

    .certificate-upload-form > *,
    .certificate-form-field {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        grid-column: 1 / -1 !important;
    }

    .certificate-form-field input,
    .certificate-form-field select,
    .certificate-upload-form input,
    .certificate-upload-form select,
    .certificate-upload-form textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .certificate-upload-form input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
    }

    .certificate-upload-form .drop-zone {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .certificate-upload-form .btn-primary {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}


/* ==========================================================
   MEDICAMENTOS - FECHA IPHONE
   ========================================================== */

@media (max-width: 850px) {

    #fechaInicioMedicamento {
        display: block !important;

        /*
         * Safari suma visualmente el padding del
         * input date. Restamos 14px de cada lado.
         */
        width: calc(100% - 28px) !important;
        max-width: calc(100% - 28px) !important;
        min-width: 0 !important;

        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;

        padding: 0 14px !important;
        margin: 0 !important;

        border: 1px solid #d1d5db !important;
        border-radius: 10px !important;

       background: #f1f1f1 !important;
        color: #0f172a !important;

        font-size: 16px !important;
        font-family: Arial, sans-serif !important;
        line-height: 52px !important;

        text-align: left !important;

        /*
         * Importante:
         * el ancho calculado corresponde al contenido.
         * Los 28px de padding completan el 100%.
         */
        box-sizing: content-box !important;

        -webkit-appearance: auto !important;
        appearance: auto !important;

        overflow: hidden !important;
    }

    #fechaInicioMedicamento::-webkit-date-and-time-value {
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #fechaInicioMedicamento::-webkit-datetime-edit {
        padding: 0 !important;
        text-align: left !important;
    }
}



/* ==========================================================
   ATENCIONES - FECHAS IPHONE
   ========================================================== */

@media (max-width: 850px) {

    #fechaAtencion,
    #proximoControlAtencion {
        display: block !important;

        width: calc(100% - 28px) !important;
        max-width: calc(100% - 28px) !important;
        min-width: 0 !important;

        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;

        padding: 0 14px !important;
        margin: 0 !important;

        border: 1px solid #d1d5db !important;
        border-radius: 10px !important;

        background-color: #eeeeee !important;
        color: #0f172a !important;

        font-size: 16px !important;
        font-family: Arial, sans-serif !important;
        line-height: 52px !important;

        text-align: left !important;

        box-sizing: content-box !important;

        -webkit-appearance: auto !important;
        appearance: auto !important;

        overflow: hidden !important;
    }

    #fechaAtencion::-webkit-date-and-time-value,
    #proximoControlAtencion::-webkit-date-and-time-value {
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #fechaAtencion::-webkit-datetime-edit,
    #proximoControlAtencion::-webkit-datetime-edit {
        padding: 0 !important;
        text-align: left !important;
    }
}



/* ==========================================================
   AGENDA DEL PACIENTE - TABLA RESPONSIVE
   ========================================================== */

.agenda-patient-history-table {
    display: block;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;

    box-sizing: border-box;
}


.agenda-patient-history-table table {
    width: max-content;
    min-width: 700px;
    max-width: none;
}


@media (max-width: 850px) {

    .agenda-patient-history-table {
        width: 100%;
        max-width: 100%;

        overflow-x: auto !important;

        -webkit-overflow-scrolling: touch;
    }

    .agenda-patient-history-table table {
        width: max-content !important;
        min-width: 700px !important;
    }

    .agenda-patient-history-table th,
    .agenda-patient-history-table td {
        white-space: nowrap;
    }
}





/* ==========================================================
   PAGOS DEL PACIENTE - RESPONSIVE
   ========================================================== */

@media (max-width: 850px) {

    /* ------------------------------------------------------
       Tarjetas resumen financiero
       ------------------------------------------------------ */

    .patient-module-section .cards,
    .main .panel .cards {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;

        width: 100%;
        max-width: 100%;
        min-width: 0;

        gap: 14px;
    }

    .patient-module-section .cards > *,
    .main .panel .cards > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        box-sizing: border-box;
    }

    /* ------------------------------------------------------
       Tabla detalle de pagos
       ------------------------------------------------------ */

    .patient-payments-table {
        display: block;

        width: 100%;
        max-width: 100%;
        min-width: 0;

        overflow-x: auto !important;
        overflow-y: hidden;

        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;

        box-sizing: border-box;
    }

    .patient-payments-table table {
        width: max-content !important;
        min-width: 760px !important;
        max-width: none !important;
    }

    .patient-payments-table th,
    .patient-payments-table td {
        white-space: nowrap;
    }

    .patient-payments-table td:nth-child(2) {
        min-width: 180px;
        white-space: normal;
    }
}




/* ==========================================================
   BOLETAS / REEMBOLSOS - FECHA IPHONE
   ========================================================== */

@media (max-width: 850px) {

    #fechaBoleta {
        display: block !important;

        width: calc(100% - 28px) !important;
        max-width: calc(100% - 28px) !important;
        min-width: 0 !important;

        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;

        padding: 0 14px !important;
        margin: 0 !important;

        border: 1px solid #d1d5db !important;
        border-radius: 10px !important;

        background-color: #eeeeee !important;
        color: #0f172a !important;

        font-size: 16px !important;
        font-family: Arial, sans-serif !important;
        line-height: 52px !important;

        text-align: left !important;

        box-sizing: content-box !important;

        -webkit-appearance: auto !important;
        appearance: auto !important;

        overflow: hidden !important;
    }

    #fechaBoleta::-webkit-date-and-time-value {
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #fechaBoleta::-webkit-datetime-edit {
        padding: 0 !important;
        text-align: left !important;
    }
}





/* ==========================================================
   APUNTES - FECHA IPHONE
   ========================================================== */

@media (max-width: 850px) {

    #fechaApunte {
        display: block !important;

        width: calc(100% - 28px) !important;
        max-width: calc(100% - 28px) !important;
        min-width: 0 !important;

        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;

        padding: 0 14px !important;
        margin: 0 !important;

        border: 1px solid #d1d5db !important;
        border-radius: 10px !important;

        background-color: #eeeeee !important;
        color: #0f172a !important;

        font-size: 16px !important;
        font-family: Arial, sans-serif !important;
        line-height: 52px !important;

        text-align: left !important;

        box-sizing: content-box !important;

        -webkit-appearance: auto !important;
        appearance: auto !important;

        overflow: hidden !important;
    }

    #fechaApunte::-webkit-date-and-time-value {
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #fechaApunte::-webkit-datetime-edit {
        padding: 0 !important;
        text-align: left !important;
    }
}




/* ==========================================================
   CREAR DOCUMENTO - FECHA IPHONE
   ========================================================== */

@media (max-width: 850px) {

    #fechaCrearDocumento {
        display: block !important;

        width: calc(100% - 28px) !important;
        max-width: calc(100% - 28px) !important;
        min-width: 0 !important;

        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;

        padding: 0 14px !important;
        margin: 0 !important;

        border: 1px solid #d1d5db !important;
        border-radius: 10px !important;

        background-color: #eeeeee !important;
        color: #0f172a !important;

        font-size: 16px !important;
        font-family: Arial, sans-serif !important;
        line-height: 52px !important;

        text-align: left !important;

        box-sizing: content-box !important;

        -webkit-appearance: auto !important;
        appearance: auto !important;

        overflow: hidden !important;
    }

    #fechaCrearDocumento::-webkit-date-and-time-value {
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #fechaCrearDocumento::-webkit-datetime-edit {
        padding: 0 !important;
        text-align: left !important;
    }
}







/* ==========================================================
   EDITAR AGENDA - FECHA Y HORA IPHONE
   ========================================================== */

@media (max-width: 850px) {

    #fechaEditarAgenda,
    #horaEditarAgenda {
        display: block !important;

        width: calc(100% - 28px) !important;
        max-width: calc(100% - 28px) !important;
        min-width: 0 !important;

        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;

        padding: 0 14px !important;
        margin: 0 !important;

        border: 1px solid #d1d5db !important;
        border-radius: 10px !important;

        background-color: #eeeeee !important;
        color: #0f172a !important;

        font-size: 16px !important;
        font-family: Arial, sans-serif !important;
        line-height: 52px !important;

        text-align: left !important;

        box-sizing: content-box !important;

        -webkit-appearance: auto !important;
        appearance: auto !important;

        overflow: hidden !important;
    }

    #fechaEditarAgenda::-webkit-date-and-time-value,
    #horaEditarAgenda::-webkit-date-and-time-value {
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #fechaEditarAgenda::-webkit-datetime-edit,
    #horaEditarAgenda::-webkit-datetime-edit {
        padding: 0 !important;
        text-align: left !important;
    }
}
/* ==========================================================
   AGENDA - ACCIONES DE CADA CITA
   ========================================================== */

.agenda-actions-cell {
    min-width: 300px;
    vertical-align: middle;
}

.agenda-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.agenda-actions .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: auto;
    margin: 0;
    white-space: nowrap;
    line-height: 1.2;
    text-decoration: none;
}

@media (max-width: 900px) {
    .agenda-actions-cell {
        min-width: 240px;
    }

    .agenda-actions {
        gap: 6px;
    }
}

/* ==========================================================
   NADIEL - DOCUMENTOS MÉDICOS
   ========================================================== */

.medical-documents-module {
    display: grid;
    gap: 22px;
}

.medical-documents-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 26px;
    border: 1px solid #e6eaf0;
    border-radius: 20px;
    background: #ffffff;
}

.medical-documents-hero h2 {
    margin: 5px 0 8px;
}

.medical-documents-hero p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

.medical-documents-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
}

.medical-documents-security {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
}

.medical-document-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.medical-document-type-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 20px;
    border: 1px solid #e6eaf0;
    border-radius: 18px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease;
}

.medical-document-type-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

.medical-document-type-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #f8fafc;
    font-size: 23px;
}

.medical-document-type-card strong {
    display: block;
    margin-bottom: 4px;
    color: #17324d;
}

.medical-document-type-card small {
    display: block;
    color: #64748b;
    line-height: 1.45;
}

.medical-document-arrow {
    color: #94a3b8;
    font-size: 20px;
}

.medical-documents-history {
    padding: 24px;
    border: 1px solid #e6eaf0;
    border-radius: 20px;
    background: #ffffff;
}

.medical-documents-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.medical-documents-history-header h3 {
    margin: 4px 0 0;
}

.medical-documents-count {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.medical-documents-empty {
    padding: 42px 22px;
    text-align: center;
    border: 1px dashed #d8dee8;
    border-radius: 16px;
    background: #fbfcfe;
}

.medical-documents-empty-icon {
    margin-bottom: 12px;
    font-size: 32px;
}

.medical-documents-empty p {
    max-width: 480px;
    margin: 8px auto 0;
    color: #64748b;
    line-height: 1.6;
}

.medical-documents-list {
    display: grid;
    gap: 10px;
}

.medical-document-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 15px 16px;
    border: 1px solid #edf0f4;
    border-radius: 14px;
}

.medical-document-row-icon {
    font-size: 22px;
}

.medical-document-row-main strong {
    color: #17324d;
}

.medical-document-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
}

.medical-document-status {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.medical-document-status-firmado,
.medical-document-status-enviado {
    background: #ecfdf3;
    color: #166534;
}

.medical-document-status-listo_firma {
    background: #eff6ff;
    color: #1d4ed8;
}

.medical-document-status-anulado {
    background: #fef2f2;
    color: #991b1b;
}

@media (max-width: 760px) {
    .medical-documents-hero {
        flex-direction: column;
    }

    .medical-document-types {
        grid-template-columns: 1fr;
    }

    .medical-document-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .medical-document-status {
        grid-column: 2;
        justify-self: start;
    }
}

/* ==========================================================
   NADIEL - EDITOR DE DOCUMENTOS MÉDICOS
   ========================================================== */

.medical-document-editor {
    display: grid;
    gap: 22px;
    padding-bottom: 40px;
}

.medical-document-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 24px 26px;
    border: 1px solid #e6eaf0;
    border-radius: 20px;
    background: #ffffff;
}

.medical-document-editor-header h1 {
    margin: 5px 0 8px;
    color: #17324d;
}

.medical-document-editor-header p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

.medical-document-patient-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 20px 22px;
    border: 1px solid #e6eaf0;
    border-radius: 18px;
    background: #ffffff;
}

.medical-document-patient-card > div {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
}

.medical-document-patient-label {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.medical-document-patient-card strong {
    color: #17324d;
    font-size: 14px;
}

.medical-document-form {
    display: grid;
    gap: 18px;
}

.medical-document-form-section {
    padding: 24px;
    border: 1px solid #e6eaf0;
    border-radius: 20px;
    background: #ffffff;
}

.medical-document-form-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.medical-document-form-title h2 {
    margin: 4px 0 0;
    color: #17324d;
}

.medical-prescription-items {
    display: grid;
    gap: 18px;
}

.medical-prescription-item {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fbfcfe;
}

.medical-prescription-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.medical-prescription-item-header strong {
    color: #17324d;
    font-size: 15px;
}

.medical-prescription-remove {
    border: 0;
    background: transparent;
    color: #b42318;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.medical-document-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.medical-document-form .span-2 {
    grid-column: span 2;
}

.medical-document-form .form-group {
    min-width: 0;
}

.medical-document-form .form-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.medical-document-form input,
.medical-document-form select,
.medical-document-form textarea {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    background: #ffffff;
    color: #17324d;
    font: inherit;
    outline: none;
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.medical-document-form textarea {
    min-height: 100px;
    resize: vertical;
}

.medical-document-form input:focus,
.medical-document-form select:focus,
.medical-document-form textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .10);
}

.medical-document-form input::placeholder,
.medical-document-form textarea::placeholder {
    color: #94a3b8;
}

.medical-document-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 2px;
}

@media (max-width: 900px) {

    .medical-document-patient-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {

    .medical-document-editor-header {
        flex-direction: column;
    }

    .medical-document-form .form-grid {
        grid-template-columns: 1fr;
    }

    .medical-document-form .span-2 {
        grid-column: auto;
    }
}

@media (max-width: 520px) {

    .medical-document-patient-card {
        grid-template-columns: 1fr;
    }

    .medical-document-form-title {
        flex-direction: column;
        align-items: stretch;
    }

    .medical-document-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

/* ==========================================================
   NADIEL - VISTA DOCUMENTO MÉDICO
   ========================================================== */

.medical-document-view {
    display: grid;
    gap: 20px;
    padding-bottom: 40px;
}

.medical-document-view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    padding: 24px 26px;
    border: 1px solid #e6eaf0;
    border-radius: 20px;
    background: #ffffff;
}

.medical-document-view-header h1 {
    margin: 5px 0 6px;
    color: #17324d;
}

.medical-document-view-code {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
}

.medical-document-view-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.medical-document-view-section {
    padding: 24px;
    border: 1px solid #e6eaf0;
    border-radius: 20px;
    background: #ffffff;
}

.medical-document-view-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.medical-document-view-section-title h2 {
    margin: 4px 0 0;
    color: #17324d;
}

.medical-document-view-items {
    display: grid;
    gap: 14px;
}

.medical-document-view-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
    border: 1px solid #e7ecf2;
    border-radius: 16px;
    background: #fbfcfe;
}

.medical-document-view-item-number {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 800;
}

.medical-document-view-item-main h3 {
    margin: 3px 0 15px;
    color: #17324d;
}

.medical-document-view-grid {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.medical-document-view-grid > div {
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
}

.medical-document-view-grid span,
.medical-document-view-footer span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.medical-document-view-grid strong {
    color: #334155;
    font-size: 13px;
}

.medical-document-view-indications {
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    background: #ffffff;
}

.medical-document-view-indications span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.medical-document-view-indications p {
    margin: 0;
    color: #334155;
    line-height: 1.6;
}

.medical-document-view-text + .medical-document-view-text {
    margin-top: 18px;
}

.medical-document-view-text p {
    margin: 7px 0 0;
    color: #475569;
    line-height: 1.7;
}

.medical-document-view-footer {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 20px;
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    background: #ffffff;
}

.medical-document-view-actions {
    display: flex;
    justify-content: flex-end;
}

.medical-document-draft-note {
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    font-weight: 600;
}

.medical-document-row {
    grid-template-columns:
        auto minmax(0, 1fr) auto auto;
}

.medical-document-view-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid #dbe3ec;
    border-radius: 9px;
    background: #ffffff;
    color: #17324d;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.medical-document-view-link:hover {
    background: #f8fafc;
}

@media (max-width: 900px) {

    .medical-document-view-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {

    .medical-document-view-header {
        flex-direction: column;
    }

    .medical-document-view-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .medical-document-view-footer {
        grid-template-columns: 1fr;
    }

    .medical-document-row {
        grid-template-columns:
            auto minmax(0, 1fr);
    }

    .medical-document-status,
    .medical-document-view-link {
        grid-column: 2;
        justify-self: start;
    }
}

/* ==========================================================
   NADIEL - VISTA PREVIA A4 DOCUMENTO MÉDICO
   ========================================================== */

.medical-preview-body {
    margin: 0;
    background: #eef1f5;
    color: #172033;
}

.medical-preview-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 18px;
}

.medical-a4-sheet {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    margin: 0 auto 40px;
    padding: 20mm 18mm 18mm;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 12px 45px rgba(15, 23, 42, .14);
}

.medical-a4-draft-watermark {
    position: absolute;
    top: 43%;
    left: 50%;
    z-index: 0;
    transform:
        translate(-50%, -50%)
        rotate(-30deg);
    color: rgba(148, 163, 184, .11);
    font-size: 72px;
    font-weight: 900;
    letter-spacing: .12em;
    pointer-events: none;
}

.medical-a4-sheet > *:not(.medical-a4-draft-watermark) {
    position: relative;
    z-index: 1;
}

.medical-a4-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.medical-a4-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.medical-a4-logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #17324d;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
}

.medical-a4-brand span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

.medical-a4-doctor {
    display: block;
    color: #17324d;
    font-size: 16px;
}

.medical-a4-document-title {
    text-align: right;
}

.medical-a4-document-title span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
}

.medical-a4-document-title h1 {
    margin: 0;
    color: #17324d;
    font-size: 23px;
    letter-spacing: .02em;
}

.medical-a4-divider {
    height: 1px;
    margin: 18px 0;
    background: #dfe5ec;
}

.medical-a4-patient {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
}

.medical-a4-patient-main {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.medical-a4-patient span,
.medical-a4-date span {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.medical-a4-patient strong,
.medical-a4-date strong {
    color: #27364a;
    font-size: 10px;
}

.medical-a4-date {
    min-width: 85px;
    text-align: right;
}

.medical-a4-rx {
    min-height: 400px;
    padding: 28px 4px;
}

.medical-a4-rp {
    margin-bottom: 22px;
    color: #17324d;
    font-family: Georgia, serif;
    font-size: 24px;
    font-style: italic;
    font-weight: 700;
}

.medical-a4-medication {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 27px;
}

.medical-a4-medication-number {
    padding-top: 2px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.medical-a4-medication-content h2 {
    margin: 0 0 5px;
    color: #172033;
    font-size: 16px;
}

.medical-a4-medication-form {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 10px;
}

.medical-a4-prescription {
    color: #334155;
    font-size: 12px;
    line-height: 1.65;
}

.medical-a4-medication-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 8px;
    color: #475569;
    font-size: 10px;
}

.medical-a4-clinical-reference {
    margin-top: 8px;
    padding: 13px 15px;
    border-radius: 10px;
    background: #f8fafc;
}

.medical-a4-clinical-reference > span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.medical-a4-clinical-reference p {
    margin: 0;
    color: #475569;
    font-size: 10px;
    line-height: 1.6;
}

.medical-a4-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 30px;
    margin-top: 35px;
}

.medical-a4-signature {
    max-width: 260px;
    text-align: center;
}

.medical-a4-signature-space {
    height: 40px;
}

.medical-a4-signature-line {
    height: 1px;
    margin-bottom: 7px;
    background: #94a3b8;
}

.medical-a4-signature strong,
.medical-a4-signature span {
    display: block;
}

.medical-a4-signature strong {
    font-size: 11px;
}

.medical-a4-signature span {
    margin-top: 2px;
    color: #64748b;
    font-size: 9px;
}

.medical-a4-no-signature {
    margin-top: 8px;
    color: #b45309;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .05em;
}

.medical-a4-verification {
    text-align: right;
}

.medical-a4-verification span,
.medical-a4-verification small {
    display: block;
    color: #64748b;
    font-size: 8px;
}

.medical-a4-verification strong {
    display: block;
    margin: 3px 0;
    color: #17324d;
    font-size: 9px;
}

.medical-a4-warning {
    margin-top: 22px;
    padding: 9px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    text-align: center;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .04em;
}

@media print {

    @page {
        size: A4;
        margin: 0;
    }

    .medical-preview-toolbar {
        display: none !important;
    }

    .medical-preview-body {
        background: #ffffff;
    }

    .medical-a4-sheet {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        box-shadow: none;
        page-break-after: always;
    }
}

@media screen and (max-width: 900px) {

    .medical-a4-sheet {
        width: calc(100% - 24px);
        min-height: auto;
        padding: 28px 24px;
    }

    .medical-a4-patient-main {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================
   NADIEL - LOGO REAL EN DOCUMENTOS MÉDICOS
   ========================================================== */

.medical-a4-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    height: 58px;
    min-width: 58px;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.medical-a4-logo img {
    display: block;
    width: auto;
    height: 58px;
    max-width: 180px;
    object-fit: contain;
    object-position: left center;
}

@media print {

    .medical-a4-logo img {
        height: 58px;
        max-width: 180px;
    }

}

/* ==========================================================
   NADIEL - AJUSTE LOGO RECETA
   ========================================================== */

.medical-a4-logo {
    height: 82px;
    min-width: 82px;
}

.medical-a4-logo img {
    width: auto;
    height: 82px;
    max-width: 220px;
    object-fit: contain;
    object-position: left center;
}

.medical-a4-brand {
    gap: 16px;
}

@media print {

    .medical-a4-logo {
        height: 82px;
        min-width: 82px;
    }

    .medical-a4-logo img {
        height: 82px;
        max-width: 220px;
    }

}

/* ==========================================================
   NADIEL - PIE INFERIOR DOCUMENTOS A4
   ========================================================== */

/*
 * La hoja se comporta como una columna.
 * El contenido clínico puede crecer y el bloque final
 * se mantiene hacia la parte inferior.
 */
.medical-a4-sheet {
    display: flex;
    flex-direction: column;
}

/*
 * Rp/ y medicamentos ocupan el espacio disponible.
 */
.medical-a4-rx {
    flex: 1 0 auto;
    min-height: 0;
}

/*
 * Si existe referencia clínica, permanece inmediatamente
 * después de la prescripción.
 */
.medical-a4-clinical-reference {
    flex-shrink: 0;
}

/*
 * Firma y verificación permanecen juntas.
 */
.medical-a4-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 28px;
}

/*
 * Advertencia final.
 */
.medical-a4-warning {
    flex-shrink: 0;
    margin-top: 18px;
}

/*
 * Evitar cortes incómodos al imprimir.
 */
.medical-a4-medication,
.medical-a4-clinical-reference,
.medical-a4-footer,
.medical-a4-warning {
    break-inside: avoid;
    page-break-inside: avoid;
}

@media print {

    .medical-a4-sheet {
        display: flex;
        flex-direction: column;
        height: 297mm;
        min-height: 297mm;
    }

    .medical-a4-footer {
        margin-top: auto;
    }

}

/* ==========================================================
   NADIEL - HISTORIAL FIRMA ELECTRÓNICA
   ========================================================== */

.medical-fea-history {
    padding: 24px;
    border: 1px solid #e6eaf0;
    border-radius: 20px;
    background: #ffffff;
}

.medical-fea-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.medical-fea-history-header h2 {
    margin: 4px 0 6px;
    color: #17324d;
}

.medical-fea-history-header p {
    margin: 0;
    color: #64748b;
    line-height: 1.55;
}

.medical-fea-history-count {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.medical-fea-timeline {
    display: grid;
    gap: 0;
}

.medical-fea-event {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding-bottom: 22px;
}

.medical-fea-event:last-child {
    padding-bottom: 0;
}

.medical-fea-event::before {
    content: "";
    position: absolute;
    top: 36px;
    bottom: 0;
    left: 17px;
    width: 2px;
    background: #e8edf3;
}

.medical-fea-event:last-child::before {
    display: none;
}

.medical-fea-event-marker {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 15px;
}

.medical-fea-event-success .medical-fea-event-marker {
    background: #ecfdf3;
}

.medical-fea-event-error .medical-fea-event-marker {
    background: #fef2f2;
}

.medical-fea-event-info .medical-fea-event-marker {
    background: #eff6ff;
}

.medical-fea-event-content {
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid #edf0f4;
    border-radius: 14px;
    background: #fbfcfe;
}

.medical-fea-event-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.medical-fea-event-top strong {
    color: #17324d;
}

.medical-fea-event-top time {
    color: #94a3b8;
    font-size: 11px;
    white-space: nowrap;
}

.medical-fea-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
}

.medical-fea-event-content p {
    margin: 10px 0 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.55;
}

.medical-fea-event-hash {
    margin-top: 10px;
}

.medical-fea-event-hash summary {
    cursor: pointer;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.medical-fea-event-hash code {
    display: block;
    margin-top: 8px;
    padding: 10px;
    overflow-wrap: anywhere;
    border-radius: 9px;
    background: #f1f5f9;
    color: #334155;
    font-size: 10px;
}

@media (max-width: 760px) {

    .medical-fea-history {
        padding: 18px;
    }

    .medical-fea-event {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
    }

    .medical-fea-event-marker {
        width: 32px;
        height: 32px;
    }

    .medical-fea-event::before {
        left: 15px;
    }

    .medical-fea-event-top {
        flex-direction: column;
        gap: 4px;
    }
}

/* ==========================================================
   NADIEL - FAVORITOS DE PRESCRIPCIÓN
   ========================================================== */

.medical-prescription-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

.medical-prescription-main {
    min-width: 0;
}

.medical-prescription-favorites {
    position: sticky;
    top: 20px;
    padding: 18px;
    border: 1px solid #e6eaf0;
    border-radius: 18px;
    background: #fbfcfe;
}

.medical-prescription-favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.medical-prescription-favorites-header h3 {
    margin: 4px 0 0;
    color: #17324d;
}

.medical-prescription-favorites-count {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.medical-prescription-favorites-search {
    margin-bottom: 14px;
}

.medical-prescription-favorites-search input {
    width: 100%;
}

.medical-prescription-favorites-list {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 2px;
}

.medical-prescription-favorite-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    background: #ffffff;
}

.medical-prescription-favorite-main {
    min-width: 0;
}

.medical-prescription-favorite-main strong,
.medical-prescription-favorite-main span,
.medical-prescription-favorite-main small {
    display: block;
}

.medical-prescription-favorite-main strong {
    margin-bottom: 4px;
    color: #17324d;
}

.medical-prescription-favorite-main span {
    color: #475569;
    font-size: 12px;
}

.medical-prescription-favorite-main small {
    margin-top: 4px;
    color: #94a3b8;
    line-height: 1.4;
}

.medical-prescription-favorite-use {
    white-space: nowrap;
}

.medical-prescription-favorites-empty {
    padding: 28px 16px;
    text-align: center;
    border: 1px dashed #d8dee8;
    border-radius: 14px;
    background: #ffffff;
}

.medical-prescription-favorites-empty > div {
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 28px;
}

.medical-prescription-favorites-empty strong {
    display: block;
    color: #475569;
}

.medical-prescription-favorites-empty p {
    margin: 6px 0 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 980px) {

    .medical-prescription-workspace {
        grid-template-columns: 1fr;
    }

    .medical-prescription-favorites {
        position: static;
    }

    .medical-prescription-favorites-list {
        max-height: none;
    }
}

/* ==========================================================
   NADIEL - GUARDAR FAVORITO
   ========================================================== */

.medical-prescription-item-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.medical-prescription-favorite-save {
    padding: 7px 10px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color .15s ease,
        background .15s ease,
        color .15s ease;
}

.medical-prescription-favorite-save:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #17324d;
}

.medical-prescription-favorite-save.is-saving {
    opacity: .6;
    pointer-events: none;
}

.medical-prescription-favorite-save.is-saved {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.medical-prescription-favorite-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.medical-prescription-favorite-delete {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #fee2e2;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.medical-prescription-favorite-delete:hover {
    background: #fef2f2;
}


/* ==========================================================
   NADIEL - AUTOCOMPLETADO DE MEDICAMENTOS
   ========================================================== */

.medical-medication-autocomplete {
    position: relative;
}

.medical-medication-autocomplete-results {
    position: absolute;
    z-index: 80;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow:
        0 14px 35px rgba(15, 23, 42, .12);
}

.medical-medication-autocomplete-results.is-open {
    display: block;
}

.medical-medication-autocomplete-option {
    display: block;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.medical-medication-autocomplete-option:last-child {
    border-bottom: 0;
}

.medical-medication-autocomplete-option:hover,
.medical-medication-autocomplete-option.is-active {
    background: #f8fafc;
}

.medical-medication-autocomplete-option strong {
    display: block;
    color: #17324d;
    font-size: 13px;
}

.medical-medication-autocomplete-option small {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 11px;
}

.medical-medication-autocomplete-free {
    color: #475569;
}


/* ==========================================================
   NADIEL - VADEMÉCUM AJAX
   ========================================================== */

.medical-medication-autocomplete-meta {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 10px;
}

.medical-medication-autocomplete-status {
    padding: 13px 14px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}


/* =========================================================
   NADIEL - Cancelación masiva de consultas
   ========================================================= */

body:has(.cancelacion-masiva-page) .main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
    box-sizing: border-box;
}

body:has(.cancelacion-masiva-page) .cancelacion-masiva-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
    box-sizing: border-box;
}

@media (max-width: 900px) {

    body:has(.cancelacion-masiva-page) .main-content {
        margin-left: 0;
        width: 100%;
    }

    body:has(.cancelacion-masiva-page) .cancelacion-masiva-page {
        padding: 18px;
    }
}


/* =========================================================
   NADIEL - Chat interno flotante V1
   ========================================================= */

.nadiel-chat-flotante {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


/* Botón flotante */

.nadiel-chat-boton {
    position: relative;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #17324d;
    box-shadow:
        0 10px 30px
        rgba(15, 23, 42, .24);
    cursor: pointer;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.nadiel-chat-boton:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 34px
        rgba(15, 23, 42, .30);
}

.nadiel-chat-boton-icono {
    font-size: 25px;
    line-height: 1;
}


/* Badge */

.nadiel-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    box-sizing: border-box;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.nadiel-chat-badge[hidden] {
    display: none !important;
}


/* Ventana */

.nadiel-chat-ventana {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 370px;
    height: 520px;
    max-height:
        calc(100vh - 120px);
    overflow: hidden;
    border:
        1px solid
        #dce4ee;
    border-radius: 20px;
    background: #ffffff;
    box-shadow:
        0 20px 55px
        rgba(15, 23, 42, .20);
}

.nadiel-chat-ventana[hidden] {
    display: none !important;
}


/* Cabecera */

.nadiel-chat-header {
    height: 70px;
    padding: 0 16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom:
        1px solid
        #e2e8f0;
    background: #ffffff;
}

.nadiel-chat-identidad {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.nadiel-chat-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f4cd69;
    color: #17324d;
    font-size: 15px;
    font-weight: 800;
}

.nadiel-chat-identidad > div:last-child {
    min-width: 0;
}

.nadiel-chat-identidad strong {
    display: block;
    max-width: 205px;
    overflow: hidden;
    color: #17324d;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nadiel-chat-estado {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

.nadiel-chat-estado i {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #22c55e;
}


/* Acciones de cabecera */

.nadiel-chat-header-acciones {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nadiel-chat-icon-button {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    font-size: 16px;
    cursor: pointer;
}

.nadiel-chat-icon-button:hover {
    background: #f1f5f9;
}


/* Área de conversación */

.nadiel-chat-mensajes {
    height:
        calc(100% - 70px - 67px);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 17px;
    background: #f5f7fa;
    scroll-behavior: smooth;
}

.nadiel-chat-vacio {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
    color: #64748b;
    text-align: center;
}

.nadiel-chat-vacio-icono {
    margin-bottom: 10px;
    font-size: 30px;
    opacity: .75;
}

.nadiel-chat-vacio strong {
    margin-bottom: 5px;
    color: #334155;
    font-size: 14px;
}

.nadiel-chat-vacio span {
    font-size: 12px;
    line-height: 1.5;
}


/* Barra para escribir */

.nadiel-chat-formulario {
    height: 67px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 11px;
    box-sizing: border-box;
    border-top:
        1px solid
        #e2e8f0;
    background: #ffffff;
}

.nadiel-chat-formulario textarea {
    flex: 1;
    height: 44px;
    max-height: 44px;
    resize: none;
    box-sizing: border-box;
    padding: 12px 13px;
    border:
        1px solid
        #cbd5e1;
    border-radius: 13px;
    outline: none;
    background: #ffffff;
    color: #1e293b;
    font-family: inherit;
    font-size: 13px;
    line-height: 18px;
}

.nadiel-chat-formulario textarea:focus {
    border-color: #94a3b8;
    box-shadow:
        0 0 0 3px
        rgba(23, 50, 77, .06);
}

.nadiel-chat-formulario textarea:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

.nadiel-chat-formulario button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #17324d;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
}

.nadiel-chat-formulario button:disabled {
    opacity: .45;
    cursor: not-allowed;
}


/* Móvil */

@media (max-width: 600px) {

    .nadiel-chat-flotante {
        right: 14px;
        bottom: 14px;
    }

    .nadiel-chat-boton {
        width: 54px;
        height: 54px;
    }

    .nadiel-chat-ventana {
        position: fixed;
        top: 12px;
        right: 12px;
        bottom: 78px;
        left: 12px;
        width: auto;
        height: auto;
        max-height: none;
        border-radius: 18px;
    }
}


/* =========================================================
   NADIEL - Burbujas chat interno
   ========================================================= */

.nadiel-chat-mensaje-fila {
    display: flex;
    width: 100%;
    margin-bottom: 10px;
}

.nadiel-chat-mensaje-propio {
    justify-content: flex-end;
}

.nadiel-chat-mensaje-ajeno {
    justify-content: flex-start;
}

.nadiel-chat-mensaje-burbuja {
    max-width: 78%;
    padding: 9px 11px 7px;
    border-radius: 14px;
    box-sizing: border-box;
    word-break: break-word;
}

.nadiel-chat-mensaje-propio
.nadiel-chat-mensaje-burbuja {
    background: #17324d;
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

.nadiel-chat-mensaje-ajeno
.nadiel-chat-mensaje-burbuja {
    background: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 5px;
}

.nadiel-chat-mensaje-texto {
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.5;
}

.nadiel-chat-mensaje-meta {
    margin-top: 4px;
    font-size: 9px;
    text-align: right;
    opacity: .68;
}


/* =========================================================
   NADIEL - Chat compacto
   ========================================================= */

.nadiel-chat-ventana.nadiel-chat-compacto {
    width: 310px;
    height: 400px;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-header {
    height: 60px;
    padding: 0 12px;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 13px;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-identidad strong {
    max-width: 155px;
    font-size: 13px;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-mensajes {
    height:
        calc(100% - 60px - 60px);
    padding: 12px;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-formulario {
    height: 60px;
    padding: 8px 9px;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-formulario textarea {
    height: 40px;
    max-height: 40px;
    padding: 10px 11px;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-formulario button {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
}

@media (max-width: 600px) {

    .nadiel-chat-ventana.nadiel-chat-compacto {
        top: auto;
        right: 12px;
        bottom: 78px;
        left: auto;
        width: min(
            310px,
            calc(100vw - 24px)
        );
        height: 400px;
    }
}


/* =========================================================
   NADIEL - Chat V2: burbujas + tamaño libre
   ========================================================= */

/*
 * Las filas no deben heredar distribuciones de otros
 * componentes del portal.
 */

.nadiel-chat-mensaje-fila {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 0 10px !important;
}

.nadiel-chat-mensaje-propio {
    justify-content: flex-end !important;
}

.nadiel-chat-mensaje-ajeno {
    justify-content: flex-start !important;
}


/*
 * Burbuja con ancho natural.
 */

.nadiel-chat-mensaje-burbuja {
    display: block !important;
    width: fit-content !important;
    min-width: 48px;
    max-width: 78% !important;
    box-sizing: border-box;
    padding: 9px 11px 7px !important;
    overflow-wrap: anywhere;
    word-break: normal !important;
}


/*
 * Texto del mensaje.
 */

.nadiel-chat-mensaje-texto {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    white-space: pre-wrap !important;
    font-size: 13px;
    line-height: 1.45;
}


/*
 * Hora / estado.
 */

.nadiel-chat-mensaje-meta {
    display: block !important;
    width: 100% !important;
    margin: 5px 0 0 !important;
    padding: 0 !important;
    text-align: right !important;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1.2;
    opacity: .65;
}


/*
 * Ventana redimensionable.
 */

.nadiel-chat-ventana {
    min-width: 280px;
    min-height: 320px;

    max-width:
        min(
            720px,
            calc(100vw - 40px)
        );

    max-height:
        calc(100vh - 100px);
}


/*
 * Esquina superior izquierda para cambiar tamaño.
 *
 * Como el chat está anclado abajo a la derecha,
 * redimensionar desde arriba/izquierda resulta natural.
 */

.nadiel-chat-resize-handle {
    position: absolute;
    top: 0;
    left: 0;

    width: 22px;
    height: 22px;

    z-index: 20;

    cursor: nwse-resize;
}

.nadiel-chat-resize-handle::before {
    content: '';

    position: absolute;

    top: 6px;
    left: 6px;

    width: 8px;
    height: 8px;

    border-top:
        2px solid
        rgba(100, 116, 139, .55);

    border-left:
        2px solid
        rgba(100, 116, 139, .55);

    border-radius: 2px 0 0 0;
}


/*
 * En móvil usamos el tamaño adaptativo existente.
 */

@media (max-width: 600px) {

    .nadiel-chat-resize-handle {
        display: none;
    }

    .nadiel-chat-ventana {
        min-width: 0;
        min-height: 0;
        max-width: none;
    }
}


/* =========================================================
   NADIEL - Coordinación Chat + Recordatorios
   ========================================================= */

#abrirRecordatorioFlotante,
#compositorRecordatorioFlotante,
#dockRecordatorios {
    transition:
        right .20s ease,
        bottom .20s ease,
        top .20s ease;
}


/* =========================================================
   NADIEL - Adjuntos del chat
   ========================================================= */

.nadiel-chat-drop-overlay {
    position: absolute;
    inset: 0;
    z-index: 60;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
    box-sizing: border-box;

    background:
        rgba(248, 250, 252, .92);

    backdrop-filter:
        blur(5px);

    -webkit-backdrop-filter:
        blur(5px);
}

.nadiel-chat-drop-overlay[hidden] {
    display: none !important;
}

.nadiel-chat-drop-contenido {
    width: 100%;
    max-width: 290px;

    padding: 28px 20px;

    border:
        2px dashed
        #94a3b8;

    border-radius: 18px;

    background:
        rgba(255,255,255,.92);

    text-align: center;
}

.nadiel-chat-drop-icono {
    margin-bottom: 10px;
    font-size: 32px;
}

.nadiel-chat-drop-contenido strong {
    display: block;

    color: #17324d;
    font-size: 15px;
}

.nadiel-chat-drop-contenido span {
    display: block;

    margin-top: 6px;

    color: #64748b;
    font-size: 11px;
    line-height: 1.5;
}


/* Tarjeta adjunto */

.nadiel-chat-adjunto {
    display: block;

    margin-top: 7px;

    overflow: hidden;

    border:
        1px solid
        rgba(148, 163, 184, .35);

    border-radius: 11px;

    background:
        rgba(255,255,255,.12);
}

.nadiel-chat-mensaje-ajeno
.nadiel-chat-adjunto {
    background: #f8fafc;
}

.nadiel-chat-adjunto-imagen {
    display: block;

    width: 100%;
    max-height: 190px;

    object-fit: cover;

    background: #e2e8f0;

    cursor: pointer;
}

.nadiel-chat-adjunto-info {
    display: flex;
    align-items: center;
    gap: 9px;

    min-width: 0;

    padding: 9px 10px;
}

.nadiel-chat-adjunto-icono {
    flex: 0 0 28px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background:
        rgba(148,163,184,.16);

    font-size: 16px;
}

.nadiel-chat-adjunto-copy {
    min-width: 0;
    flex: 1;
}

.nadiel-chat-adjunto-copy strong {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 11px;
}

.nadiel-chat-adjunto-copy small {
    display: block;

    margin-top: 2px;

    opacity: .68;

    font-size: 9px;
}

.nadiel-chat-adjunto-descargar {
    flex: 0 0 auto;

    padding: 5px 7px;

    border-radius: 7px;

    color: inherit;
    text-decoration: none;

    font-size: 14px;
}

.nadiel-chat-adjunto-descargar:hover {
    background:
        rgba(148,163,184,.16);
}


/* Estado de subida */

.nadiel-chat-subiendo {
    display: flex;
    align-items: center;
    gap: 8px;

    margin: 8px 0;

    padding: 9px 10px;

    border-radius: 10px;

    background: #eef2f7;

    color: #475569;

    font-size: 11px;
}


/* =========================================================
   NADIEL - Chat móvil V5
   ========================================================= */

@media (max-width: 600px) {

    /*
     * Contenedor flotante.
     */

    .nadiel-chat-flotante {
        right: 10px !important;
        bottom:
            calc(
                10px
                + env(safe-area-inset-bottom, 0px)
            ) !important;
    }


    /*
     * En móvil ignoramos cualquier tamaño manual
     * almacenado desde escritorio.
     */

    .nadiel-chat-ventana,
    .nadiel-chat-ventana.nadiel-chat-compacto {
        position: fixed !important;

        top: auto !important;
        left: 10px !important;
        right: 10px !important;

        bottom:
            calc(
                78px
                + env(safe-area-inset-bottom, 0px)
            ) !important;

        width: auto !important;

        height:
            min(
                620px,
                calc(100dvh - 115px)
            ) !important;

        min-width: 0 !important;
        min-height: 280px !important;

        max-width: none !important;
        max-height:
            calc(100dvh - 105px) !important;

        border-radius: 18px !important;

        overflow: hidden !important;
    }


    /*
     * Sin redimensionamiento manual en teléfono.
     */

    .nadiel-chat-resize-handle {
        display: none !important;
    }


    /*
     * Cabecera más compacta.
     */

    .nadiel-chat-header {
        height: 62px !important;
        min-height: 62px !important;

        padding:
            0 12px !important;
    }

    .nadiel-chat-avatar {
        width: 38px !important;
        height: 38px !important;
        flex-basis: 38px !important;

        font-size: 14px !important;
    }

    .nadiel-chat-identidad {
        gap: 9px !important;
    }

    .nadiel-chat-identidad strong {
        max-width:
            calc(100vw - 205px) !important;

        font-size: 13px !important;
    }

    .nadiel-chat-estado {
        margin-top: 2px !important;
        font-size: 10px !important;
    }

    .nadiel-chat-header-acciones {
        gap: 1px !important;
    }

    .nadiel-chat-icon-button {
        width: 31px !important;
        height: 31px !important;

        font-size: 14px !important;
    }


    /*
     * Área central.
     */

    .nadiel-chat-mensajes {
        height:
            calc(
                100%
                - 62px
                - 58px
            ) !important;

        padding: 12px 10px !important;

        overscroll-behavior: contain;

        -webkit-overflow-scrolling: touch;
    }


    /*
     * Burbujas.
     */

    .nadiel-chat-mensaje-fila {
        margin-bottom: 8px !important;
    }

    .nadiel-chat-mensaje-burbuja {
        min-width: 42px !important;
        max-width: 82% !important;

        padding:
            8px 10px 6px !important;

        border-radius: 13px !important;
    }

    .nadiel-chat-mensaje-texto {
        font-size: 13px !important;
        line-height: 1.38 !important;
    }

    .nadiel-chat-mensaje-meta {
        margin-top: 4px !important;

        font-size: 9px !important;
    }


    /*
     * Adjuntos más compactos.
     */

    .nadiel-chat-adjunto {
        max-width: 100% !important;
    }

    .nadiel-chat-adjunto-tarjeta {
        max-width: 100% !important;
    }


    /*
     * Barra de escritura.
     *
     * 16px es deliberado: evita que Safari haga
     * zoom automático al enfocar el textarea.
     */

    .nadiel-chat-formulario {
        height: 58px !important;

        gap: 7px !important;

        padding:
            7px 8px !important;
    }

    .nadiel-chat-formulario textarea {
        height: 44px !important;
        max-height: 44px !important;

        padding:
            11px 12px !important;

        border-radius: 12px !important;

        font-size: 16px !important;
        line-height: 20px !important;
    }

    .nadiel-chat-formulario button {
        width: 44px !important;
        height: 44px !important;
        flex-basis: 44px !important;

        border-radius: 12px !important;
    }


    /*
     * Botón flotante.
     */

    .nadiel-chat-boton {
        width: 54px !important;
        height: 54px !important;
    }

}


/* =========================================================
   NADIEL - Chat móvil V5.1 / teclado iPhone
   ========================================================= */

@media (max-width: 600px) {

    .nadiel-chat-ventana,
    .nadiel-chat-ventana.nadiel-chat-compacto {
        height:
            var(
                --nadiel-chat-mobile-height,
                min(
                    620px,
                    calc(100dvh - 115px)
                )
            ) !important;

        bottom:
            var(
                --nadiel-chat-mobile-bottom,
                calc(
                    78px
                    + env(
                        safe-area-inset-bottom,
                        0px
                    )
                )
            ) !important;
    }
}


/* =========================================================
   NADIEL - Reloj horario Chile
   ========================================================= */

.nadiel-chat-header {
    position: relative;
}

.nadiel-chat-hora-chile {
    position: absolute;

    right: 15px;
    bottom: 5px;

    color: #64748b;

    font-size: 9px;
    font-weight: 700;

    line-height: 1;

    white-space: nowrap;

    pointer-events: none;
}

@media (max-width: 600px) {

    .nadiel-chat-hora-chile {
        right: 12px;
        bottom: 4px;

        font-size: 8px;
    }
}


/* =========================================================
   NADIEL - Reloj Chile V2
   Mayor legibilidad
   ========================================================= */

.nadiel-chat-hora-chile {
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
}

@media (max-width: 600px) {

    .nadiel-chat-hora-chile {
        font-size: 10px !important;
        font-weight: 700 !important;
    }

}


/* =========================================================
   NADIEL - Fecha y hora de mensajes V2
   Mayor legibilidad
   ========================================================= */

.nadiel-chat-mensaje-meta {
    font-size: 11px !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
}

@media (max-width: 600px) {

    #nadielChatVentana
    .nadiel-chat-mensaje-meta {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

}


/* =========================================================
   NADIEL - Reloj Chile en Sidebar
   ========================================================= */

.sidebar-chile-clock {
    margin: 14px 0 18px;
    padding: 12px 14px;

    border:
        1px solid
        rgba(255, 255, 255, .12);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, .055);

    color: #ffffff;

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, .04);
}

.sidebar-chile-clock-label {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 7px;

    color: #f4cd69;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .06em;

    text-transform: uppercase;
}

.sidebar-chile-clock-date {
    color: #cbd5e1;

    font-size: 11px;
    font-weight: 650;

    line-height: 1.25;
}

.sidebar-chile-clock-time {
    margin-top: 2px;

    color: #ffffff;

    font-size: 20px;
    font-weight: 800;

    line-height: 1.1;

    letter-spacing: .02em;
}


/*
 * Sidebar colapsado:
 * dejamos solo la bandera/reloj de forma compacta.
 */

.sidebar.sidebar-collapsed
.sidebar-chile-clock {
    padding: 10px 7px;

    text-align: center;
}

.sidebar.sidebar-collapsed
.sidebar-chile-clock-label {
    justify-content: center;

    margin: 0;

    font-size: 0;
}

.sidebar.sidebar-collapsed
.sidebar-chile-clock-label span:first-child {
    font-size: 17px;
}

.sidebar.sidebar-collapsed
.sidebar-chile-clock-date,
.sidebar.sidebar-collapsed
.sidebar-chile-clock-time {
    display: none;
}


/* ================================================================
   NADIEL - REEMBOLSOS FLOW RESPONSIVE V1
================================================================ */

.reembolso-accion-detalle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: max-content;
    min-width: 118px;

    white-space: nowrap;
    flex-shrink: 0;
}


/*
|--------------------------------------------------------------------------
| Evitar que la columna de acciones colapse
|--------------------------------------------------------------------------
*/

.reembolsos-tabla th:last-child,
.reembolsos-tabla td:last-child {
    min-width: 135px;
    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| En pantallas pequeñas permitimos desplazamiento horizontal
|--------------------------------------------------------------------------
*/

.reembolsos-tabla-contenedor {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/*
|--------------------------------------------------------------------------
| La tabla conserva un ancho mínimo legible
|--------------------------------------------------------------------------
*/

.reembolsos-tabla {
    width: 100%;
    min-width: 900px;
}


/*
|--------------------------------------------------------------------------
| NADIEL - Fiestas Patrias Chile 2026
|--------------------------------------------------------------------------
|
| Decoración temporal septiembre.
| No interfiere con clics ni contenido del portal.
|
*/

.nadiel-fiestas-patrias {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    overflow: hidden;
}


/*
|--------------------------------------------------------------------------
| Guirnalda superior
|--------------------------------------------------------------------------
*/

.nadiel-guirnalda {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 36px;

    display: flex;
    justify-content: space-around;
    align-items: flex-start;

    padding: 0 18px;

    filter:
        drop-shadow(
            0 4px 5px
            rgba(15, 23, 42, 0.10)
        );
}

.nadiel-guirnalda::before {
    content: "";

    position: absolute;
    top: 4px;
    left: 0;

    width: 100%;
    height: 2px;

    background:
        rgba(71, 85, 105, 0.35);
}

.banderin {
    position: relative;

    width: 19px;
    height: 25px;

    margin-top: 5px;

    clip-path:
        polygon(
            0 0,
            100% 0,
            50% 100%
        );

    transform-origin:
        50% 0;

    animation:
        nadiel-banderin-movimiento
        3.8s
        ease-in-out
        infinite;
}

.banderin:nth-child(2n) {
    animation-delay: -0.8s;
}

.banderin:nth-child(3n) {
    animation-delay: -1.6s;
}

.bandera-azul {
    background: #0039a6;
}

.bandera-blanca {
    background: #ffffff;
    border:
        1px solid
        rgba(15, 23, 42, 0.10);
}

.bandera-roja {
    background: #d52b1e;
}


/*
|--------------------------------------------------------------------------
| Confeti discreto
|--------------------------------------------------------------------------
*/

.fiesta-confeti {
    position: fixed;

    top: -18px;

    width: 7px;
    height: 12px;

    border-radius: 2px;

    opacity: 0.42;

    animation:
        nadiel-confeti-caida
        10s
        linear
        infinite;
}

.confeti-1 {
    left: 8%;
    background: #0039a6;
    animation-delay: -1s;
}

.confeti-2 {
    left: 19%;
    background: #d52b1e;
    animation-delay: -7s;
}

.confeti-3 {
    left: 31%;
    background: #ffffff;
    box-shadow:
        0 0 0 1px
        rgba(15, 23, 42, 0.12);
    animation-delay: -4s;
}

.confeti-4 {
    left: 44%;
    background: #0039a6;
    animation-delay: -8s;
}

.confeti-5 {
    left: 58%;
    background: #d52b1e;
    animation-delay: -3s;
}

.confeti-6 {
    left: 70%;
    background: #ffffff;
    box-shadow:
        0 0 0 1px
        rgba(15, 23, 42, 0.12);
    animation-delay: -6s;
}

.confeti-7 {
    left: 82%;
    background: #0039a6;
    animation-delay: -2s;
}

.confeti-8 {
    left: 94%;
    background: #d52b1e;
    animation-delay: -9s;
}


/*
|--------------------------------------------------------------------------
| Animaciones
|--------------------------------------------------------------------------
*/

@keyframes nadiel-banderin-movimiento {

    0%,
    100% {
        transform:
            rotate(-2deg);
    }

    50% {
        transform:
            rotate(4deg);
    }
}

@keyframes nadiel-confeti-caida {

    0% {
        transform:
            translateY(-30px)
            rotate(0deg);

        opacity: 0;
    }

    8% {
        opacity: 0.42;
    }

    92% {
        opacity: 0.30;
    }

    100% {
        transform:
            translateY(105vh)
            rotate(420deg);

        opacity: 0;
    }
}


/*
|--------------------------------------------------------------------------
| Móvil
|--------------------------------------------------------------------------
*/

@media (max-width: 700px) {

    .nadiel-guirnalda {
        height: 28px;
        padding:
            0 8px;
    }

    .banderin {
        width: 14px;
        height: 19px;
    }

    .fiesta-confeti {
        opacity: 0.30;
    }
}


/*
|--------------------------------------------------------------------------
| Accesibilidad
|--------------------------------------------------------------------------
*/

@media (
    prefers-reduced-motion: reduce
) {

    .banderin,
    .fiesta-confeti {
        animation: none !important;
    }

    .fiesta-confeti {
        display: none;
    }
}



/*
|--------------------------------------------------------------------------
| Saludo Fiestas Patrias - Dashboard
|--------------------------------------------------------------------------
*/

.dashboard-fiestas-patrias {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin: 10px 0 6px;
    padding: 9px 13px;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            rgba(0, 57, 166, 0.08),
            rgba(255, 255, 255, 0.94),
            rgba(213, 43, 30, 0.08)
        );

    border:
        1px solid
        rgba(148, 163, 184, 0.22);

    box-shadow:
        0 6px 18px
        rgba(15, 23, 42, 0.05);
}

.dashboard-fiestas-patrias > span {
    font-size: 23px;
    line-height: 1;
}

.dashboard-fiestas-patrias div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dashboard-fiestas-patrias strong {
    color: #17324d;
    font-size: 14px;
    font-weight: 700;
}

.dashboard-fiestas-patrias small {
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 700px) {

    .dashboard-fiestas-patrias {
        width: 100%;
        align-items: flex-start;
    }
}



/*
|--------------------------------------------------------------------------
| NADIEL - Decoraciones anuales
|--------------------------------------------------------------------------
*/


/* CUMPLEAÑOS DRA. NASLY */

.nadiel-cumple-doctora {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    overflow: hidden;
}

.cumple-globo,
.cumple-particula {
    position: fixed;
    user-select: none;
}

.cumple-globo {
    bottom: -70px;
    font-size: 30px;
    opacity: 0.66;
    animation: nadiel-cumple-globo 12s ease-in-out infinite;
}

.cumple-globo-1 { left: 7%; animation-delay: -2s; }
.cumple-globo-2 { left: 28%; animation-delay: -8s; }
.cumple-globo-3 { right: 27%; animation-delay: -5s; }
.cumple-globo-4 { right: 7%; animation-delay: -10s; }

.cumple-particula {
    top: -35px;
    font-size: 18px;
    animation: nadiel-cumple-particula 10s linear infinite;
}

.cumple-particula-1 { left: 11%; animation-delay: -1s; }
.cumple-particula-2 { left: 30%; animation-delay: -6s; }
.cumple-particula-3 { left: 50%; animation-delay: -3s; }
.cumple-particula-4 { left: 72%; animation-delay: -8s; }
.cumple-particula-5 { left: 91%; animation-delay: -4s; }

@keyframes nadiel-cumple-globo {
    0% {
        transform: translateY(0) rotate(-4deg);
        opacity: 0;
    }
    10% {
        opacity: 0.66;
    }
    100% {
        transform: translateY(-120vh) translateX(15px) rotate(7deg);
        opacity: 0;
    }
}

@keyframes nadiel-cumple-particula {
    0% {
        transform: translateY(-30px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.55;
    }
    100% {
        transform: translateY(105vh) rotate(420deg);
        opacity: 0;
    }
}


/* HALLOWEEN */

.nadiel-halloween {
    position: fixed;
    inset: 0;
    z-index: 9997;
    pointer-events: none;
    overflow: hidden;
}

.halloween-bat,
.halloween-pumpkin {
    position: fixed;
    user-select: none;
}

.halloween-bat {
    top: 14px;
    font-size: 20px;
    opacity: 0.58;
    animation: nadiel-halloween-vuelo 11s ease-in-out infinite;
}

.halloween-bat-1 { left: 8%; animation-delay: -2s; }
.halloween-bat-2 { left: 33%; animation-delay: -7s; }
.halloween-bat-3 { left: 68%; animation-delay: -4s; }
.halloween-bat-4 { left: 90%; animation-delay: -9s; }

.halloween-pumpkin {
    bottom: 14px;
    font-size: 25px;
    opacity: 0.50;
    animation: nadiel-halloween-flotar 4.5s ease-in-out infinite;
}

.halloween-pumpkin-1 { left: 18px; }
.halloween-pumpkin-2 { right: 18px; animation-delay: -2s; }

@keyframes nadiel-halloween-vuelo {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(-5deg);
    }
    50% {
        transform: translateY(20px) translateX(18px) rotate(8deg);
    }
}

@keyframes nadiel-halloween-flotar {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }
    50% {
        transform: translateY(-8px) rotate(4deg);
    }
}


/* NAVIDAD */

.nadiel-navidad {
    position: fixed;
    inset: 0;
    z-index: 9996;
    pointer-events: none;
    overflow: hidden;
}

.navidad-estrella,
.navidad-copo,
.navidad-arbol {
    position: fixed;
    user-select: none;
}

.navidad-estrella {
    top: 14px;
    font-size: 18px;
    animation: nadiel-navidad-brillo 3.6s ease-in-out infinite;
}

.navidad-estrella-1 { left: 15%; }
.navidad-estrella-2 { left: 50%; animation-delay: -1.4s; }
.navidad-estrella-3 { right: 15%; animation-delay: -2.4s; }

.navidad-copo {
    top: -30px;
    font-size: 15px;
    opacity: 0.42;
    animation: nadiel-navidad-nieve 12s linear infinite;
}

.navidad-copo-1 { left: 8%; animation-delay: -1s; }
.navidad-copo-2 { left: 22%; animation-delay: -6s; }
.navidad-copo-3 { left: 39%; animation-delay: -3s; }
.navidad-copo-4 { left: 58%; animation-delay: -8s; }
.navidad-copo-5 { left: 76%; animation-delay: -4s; }
.navidad-copo-6 { left: 92%; animation-delay: -10s; }

.navidad-arbol {
    bottom: 12px;
    font-size: 25px;
    opacity: 0.52;
    animation: nadiel-navidad-flotar 4.8s ease-in-out infinite;
}

.navidad-arbol-1 { left: 18px; }
.navidad-arbol-2 { right: 18px; animation-delay: -2s; }

@keyframes nadiel-navidad-brillo {
    0%, 100% {
        transform: scale(0.92);
        opacity: 0.35;
    }
    50% {
        transform: scale(1.16);
        opacity: 0.78;
    }
}

@keyframes nadiel-navidad-nieve {
    0% {
        transform: translateY(-30px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.42;
    }
    100% {
        transform: translateY(105vh) translateX(20px) rotate(300deg);
        opacity: 0;
    }
}

@keyframes nadiel-navidad-flotar {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}


/* AÑO NUEVO */

.nadiel-anio-nuevo {
    position: fixed;
    inset: 0;
    z-index: 10001;
    pointer-events: none;
    overflow: hidden;
}

.anio-nuevo-brillo,
.anio-nuevo-confeti,
.anio-nuevo-icono {
    position: fixed;
    user-select: none;
}

.anio-nuevo-brillo {
    top: 15px;
    font-size: 19px;
    animation: nadiel-anio-nuevo-brillo 3s ease-in-out infinite;
}

.anio-nuevo-brillo-1 { left: 10%; }
.anio-nuevo-brillo-2 { left: 35%; animation-delay: -1s; }
.anio-nuevo-brillo-3 { left: 66%; animation-delay: -1.8s; }
.anio-nuevo-brillo-4 { left: 90%; animation-delay: -0.6s; }

.anio-nuevo-confeti {
    top: -20px;
    width: 7px;
    height: 13px;
    border-radius: 2px;
    background: linear-gradient(180deg, #d4af37, #f8fafc);
    opacity: 0.50;
    animation: nadiel-anio-nuevo-caida 9s linear infinite;
}

.anio-nuevo-confeti-1 { left: 8%; }
.anio-nuevo-confeti-2 { left: 24%; animation-delay: -5s; }
.anio-nuevo-confeti-3 { left: 41%; animation-delay: -3s; }
.anio-nuevo-confeti-4 { left: 59%; animation-delay: -7s; }
.anio-nuevo-confeti-5 { left: 77%; animation-delay: -2s; }
.anio-nuevo-confeti-6 { left: 92%; animation-delay: -6s; }

.anio-nuevo-icono {
    bottom: 14px;
    font-size: 26px;
    opacity: 0.55;
    animation: nadiel-anio-nuevo-flotar 4s ease-in-out infinite;
}

.anio-nuevo-icono-1 { left: 18px; }
.anio-nuevo-icono-2 { right: 18px; animation-delay: -2s; }

@keyframes nadiel-anio-nuevo-brillo {
    0%, 100% {
        transform: scale(0.90);
        opacity: 0.35;
    }
    50% {
        transform: scale(1.18);
        opacity: 0.80;
    }
}

@keyframes nadiel-anio-nuevo-caida {
    0% {
        transform: translateY(-30px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.50;
    }
    100% {
        transform: translateY(105vh) rotate(420deg);
        opacity: 0;
    }
}

@keyframes nadiel-anio-nuevo-flotar {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }
    50% {
        transform: translateY(-8px) rotate(4deg);
    }
}


/* MENSAJES DASHBOARD */

.dashboard-cumple-doctora,
.dashboard-halloween,
.dashboard-navidad,
.dashboard-anio-nuevo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin: 10px 0 6px;
    padding: 10px 14px;
    border-radius: 15px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.05);
}

.dashboard-cumple-doctora {
    background: linear-gradient(
        135deg,
        rgba(236, 72, 153, 0.08),
        rgba(255, 255, 255, 0.97),
        rgba(139, 92, 246, 0.09)
    );
}

.dashboard-halloween {
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.08),
        rgba(255, 247, 237, 0.96),
        rgba(249, 115, 22, 0.10)
    );
}

.dashboard-navidad {
    background: linear-gradient(
        135deg,
        rgba(22, 101, 52, 0.08),
        rgba(255, 255, 255, 0.97),
        rgba(185, 28, 28, 0.08)
    );
}

.dashboard-anio-nuevo {
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.05),
        rgba(255, 255, 255, 0.97),
        rgba(212, 175, 55, 0.13)
    );
    border-color: rgba(212, 175, 55, 0.28);
}

.dashboard-cumple-doctora > span,
.dashboard-halloween > span,
.dashboard-navidad > span,
.dashboard-anio-nuevo > span {
    font-size: 25px;
    line-height: 1;
}

.dashboard-cumple-doctora div,
.dashboard-halloween div,
.dashboard-navidad div,
.dashboard-anio-nuevo div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dashboard-cumple-doctora strong,
.dashboard-halloween strong,
.dashboard-navidad strong,
.dashboard-anio-nuevo strong {
    color: #17324d;
    font-size: 14px;
    font-weight: 700;
}

.dashboard-cumple-doctora small,
.dashboard-halloween small,
.dashboard-navidad small,
.dashboard-anio-nuevo small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 700px) {
    .dashboard-cumple-doctora,
    .dashboard-halloween,
    .dashboard-navidad,
    .dashboard-anio-nuevo {
        width: 100%;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cumple-globo,
    .cumple-particula,
    .halloween-bat,
    .halloween-pumpkin,
    .navidad-estrella,
    .navidad-copo,
    .navidad-arbol,
    .anio-nuevo-brillo,
    .anio-nuevo-confeti,
    .anio-nuevo-icono {
        animation: none !important;
    }

    .cumple-particula,
    .navidad-copo,
    .anio-nuevo-confeti {
        display: none;
    }
}



/*
|--------------------------------------------------------------------------
| NADIEL - Día de los Angelitos
|--------------------------------------------------------------------------
*/

.nadiel-angelitos {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
}

.angelito,
.angelito-estrella {
    position: fixed;
    user-select: none;
}

.angelito {
    bottom: -60px;
    font-size: 28px;
    opacity: 0.58;

    animation:
        nadiel-angelito-subir
        12s
        ease-in-out
        infinite;
}

.angelito-1 {
    left: 8%;
    animation-delay: -2s;
}

.angelito-2 {
    left: 30%;
    animation-delay: -7s;
}

.angelito-3 {
    right: 30%;
    animation-delay: -4s;
}

.angelito-4 {
    right: 8%;
    animation-delay: -9s;
}

.angelito-estrella {
    top: -30px;
    font-size: 17px;
    opacity: 0.48;

    animation:
        nadiel-angelito-estrella
        10s
        linear
        infinite;
}

.angelito-estrella-1 {
    left: 12%;
    animation-delay: -1s;
}

.angelito-estrella-2 {
    left: 32%;
    animation-delay: -5s;
}

.angelito-estrella-3 {
    left: 52%;
    animation-delay: -3s;
}

.angelito-estrella-4 {
    left: 72%;
    animation-delay: -7s;
}

.angelito-estrella-5 {
    left: 90%;
    animation-delay: -4s;
}

@keyframes nadiel-angelito-subir {

    0% {
        transform:
            translateY(0)
            rotate(-3deg);

        opacity: 0;
    }

    10% {
        opacity: 0.58;
    }

    50% {
        transform:
            translateY(-55vh)
            translateX(10px)
            rotate(3deg);
    }

    100% {
        transform:
            translateY(-115vh)
            translateX(-12px)
            rotate(-3deg);

        opacity: 0;
    }
}

@keyframes nadiel-angelito-estrella {

    0% {
        transform:
            translateY(-30px)
            rotate(0deg);

        opacity: 0;
    }

    10% {
        opacity: 0.48;
    }

    100% {
        transform:
            translateY(105vh)
            rotate(300deg);

        opacity: 0;
    }
}


/*
|--------------------------------------------------------------------------
| Mensaje Angelitos - Dashboard
|--------------------------------------------------------------------------
*/

.dashboard-angelitos {
    display: inline-flex;
    align-items: center;
    gap: 11px;

    margin: 10px 0 6px;
    padding: 10px 14px;

    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            rgba(219, 234, 254, 0.75),
            rgba(255, 255, 255, 0.98),
            rgba(254, 249, 195, 0.60)
        );

    border:
        1px solid
        rgba(186, 230, 253, 0.70);

    box-shadow:
        0 7px 20px
        rgba(15, 23, 42, 0.05);
}

.dashboard-angelitos > span {
    font-size: 25px;
    line-height: 1;
}

.dashboard-angelitos div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dashboard-angelitos strong {
    color: #17324d;
    font-size: 14px;
    font-weight: 700;
}

.dashboard-angelitos small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 700px) {

    .dashboard-angelitos {
        width: 100%;
        align-items: flex-start;
    }
}

@media (
    prefers-reduced-motion: reduce
) {

    .angelito,
    .angelito-estrella {
        animation: none !important;
    }

    .angelito-estrella {
        display: none;
    }
}


/* =========================================================
   NADIEL - Alerta visual de mensaje nuevo
   ========================================================= */

@keyframes nadielChatPulsoMensaje {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 10px 30px
            rgba(15, 23, 42, .24);
    }

    50% {
        transform: scale(1.12);
        box-shadow:
            0 0 0 10px
            rgba(220, 38, 38, .18),
            0 14px 36px
            rgba(15, 23, 42, .30);
    }
}

@keyframes nadielChatPulsoBadge {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.30);
    }
}

@keyframes nadielChatDestelloHeader {
    0%,
    100% {
        background: #ffffff;
    }

    50% {
        background: #fff7ed;
    }
}

.nadiel-chat-boton.nadiel-chat-alerta {
    animation:
        nadielChatPulsoMensaje
        .8s ease-in-out infinite;
}

.nadiel-chat-badge.nadiel-chat-alerta {
    animation:
        nadielChatPulsoBadge
        .8s ease-in-out infinite;
}

.nadiel-chat-header.nadiel-chat-alerta {
    animation:
        nadielChatDestelloHeader
        .9s ease-in-out infinite;
}


/* =========================================================
   NADIEL - Selector de emojis del chat
   ========================================================= */

.nadiel-chat-emoji-contenedor {
    position: relative;
    flex: 0 0 auto;
}

.nadiel-chat-formulario
.nadiel-chat-emoji-boton {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    font-size: 21px;
    cursor: pointer;
    transition:
        transform .15s ease,
        background .15s ease;
}

.nadiel-chat-formulario
.nadiel-chat-emoji-boton:hover {
    background: #e2e8f0;
    transform: scale(1.04);
}

.nadiel-chat-emoji-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    z-index: 50;

    width: 244px;
    max-height: 210px;
    overflow-y: auto;

    display: grid;
    grid-template-columns:
        repeat(5, 1fr);
    gap: 5px;

    padding: 9px;

    border:
        1px solid
        #e2e8f0;
    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 14px 35px
        rgba(15, 23, 42, .18);
}

.nadiel-chat-emoji-panel[hidden] {
    display: none;
}

.nadiel-chat-formulario
.nadiel-chat-emoji-panel button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex: none;

    padding: 0;
    border: 0;
    border-radius: 9px;

    background: transparent;
    color: inherit;

    font-size: 22px;
    line-height: 40px;

    cursor: pointer;
}

.nadiel-chat-formulario
.nadiel-chat-emoji-panel button:hover {
    background: #f1f5f9;
    transform: scale(1.08);
}

@media (max-width: 600px) {

    .nadiel-chat-emoji-panel {
        width: 230px;
        grid-template-columns:
            repeat(5, 1fr);
    }
}


/* =========================================================
   NADIEL - Indicador "está escribiendo"
   ========================================================= */

.nadiel-chat-escribiendo {
    display: flex;
    align-items: center;
    gap: 7px;

    min-height: 28px;
    padding: 4px 14px 5px;

    box-sizing: border-box;

    background: #ffffff;
    color: #64748b;

    font-size: 11px;
    line-height: 16px;
}

.nadiel-chat-escribiendo[hidden] {
    display: none;
}

.nadiel-chat-escribiendo-texto {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-style: italic;
}

.nadiel-chat-escribiendo-puntos {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
}

.nadiel-chat-escribiendo-puntos span {
    width: 5px;
    height: 5px;

    border-radius: 50%;
    background: #64748b;

    animation:
        nadielChatEscribiendoPunto
        1.15s infinite ease-in-out;
}

.nadiel-chat-escribiendo-puntos span:nth-child(2) {
    animation-delay: .15s;
}

.nadiel-chat-escribiendo-puntos span:nth-child(3) {
    animation-delay: .30s;
}

@keyframes nadielChatEscribiendoPunto {

    0%,
    60%,
    100% {
        opacity: .35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}



/* =========================================================
   NADIEL - Responder mensaje específico
   ========================================================= */

.nadiel-chat-respuesta-preview {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 12px;

    box-sizing: border-box;

    border-top: 1px solid #e2e8f0;
    border-left: 3px solid #64748b;

    background: #f8fafc;
}

.nadiel-chat-respuesta-preview[hidden] {
    display: none;
}

.nadiel-chat-respuesta-contenido {
    flex: 1 1 auto;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nadiel-chat-respuesta-autor {
    display: block;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 12px;
    line-height: 16px;
    font-weight: 700;

    color: #475569;
}

.nadiel-chat-respuesta-texto {
    display: block;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 12px;
    line-height: 16px;

    color: #64748b;
}

.nadiel-chat-respuesta-cancelar {
    flex: 0 0 30px;

    width: 30px;
    height: 30px;

    padding: 0;
    border: 0;
    border-radius: 50%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    color: #64748b;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}

.nadiel-chat-respuesta-cancelar:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.05);
}



/* =========================================================
   NADIEL - Botón responder mensaje
   ========================================================= */

.nadiel-chat-mensaje-fila {
    align-items: center !important;
    gap: 6px;
}

.nadiel-chat-responder-boton {
    flex: 0 0 28px;

    width: 28px;
    height: 28px;

    padding: 0;
    border: 0;
    border-radius: 50%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    color: #64748b;

    font-size: 16px;
    line-height: 1;

    cursor: pointer;

    opacity: .55;

    transition:
        opacity .15s ease,
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}

.nadiel-chat-responder-boton:hover {
    opacity: 1;

    background: #e2e8f0;
    color: #0f172a;

    transform: scale(1.06);
}


/*
 * Mensaje recibido:
 * burbuja primero, responder después.
 */

.nadiel-chat-mensaje-ajeno
.nadiel-chat-mensaje-burbuja {
    order: 1;
}

.nadiel-chat-mensaje-ajeno
.nadiel-chat-responder-boton {
    order: 2;
}


/*
 * Mensaje propio:
 * responder primero, burbuja después.
 */

.nadiel-chat-mensaje-propio
.nadiel-chat-responder-boton {
    order: 1;
}

.nadiel-chat-mensaje-propio
.nadiel-chat-mensaje-burbuja {
    order: 2;
}


@media (max-width: 600px) {

    .nadiel-chat-responder-boton {
        flex-basis: 26px;

        width: 26px;
        height: 26px;

        font-size: 15px;
    }

}



/* =========================================================
   NADIEL - Cita dentro de mensaje respondido
   ========================================================= */

.nadiel-chat-mensaje-respuesta {
    display: flex;
    flex-direction: column;
    gap: 2px;

    margin: 0 0 7px;
    padding: 7px 9px;

    border-left: 3px solid rgba(148, 163, 184, .9);
    border-radius: 8px;

    overflow: hidden;
}

.nadiel-chat-mensaje-respuesta-autor {
    display: block;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 11px;
    line-height: 15px;
    font-weight: 700;
}

.nadiel-chat-mensaje-respuesta-texto {
    display: block;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 11px;
    line-height: 15px;
}


/*
 * Cita dentro de mensaje propio.
 */

.nadiel-chat-mensaje-propio
.nadiel-chat-mensaje-respuesta {
    background: rgba(255,255,255,.12);
    border-left-color: rgba(255,255,255,.72);
}

.nadiel-chat-mensaje-propio
.nadiel-chat-mensaje-respuesta-autor {
    color: rgba(255,255,255,.95);
}

.nadiel-chat-mensaje-propio
.nadiel-chat-mensaje-respuesta-texto {
    color: rgba(255,255,255,.76);
}


/*
 * Cita dentro de mensaje recibido.
 */

.nadiel-chat-mensaje-ajeno
.nadiel-chat-mensaje-respuesta {
    background: #f1f5f9;
    border-left-color: #64748b;
}

.nadiel-chat-mensaje-ajeno
.nadiel-chat-mensaje-respuesta-autor {
    color: #334155;
}

.nadiel-chat-mensaje-ajeno
.nadiel-chat-mensaje-respuesta-texto {
    color: #64748b;
}


@media (max-width: 600px) {

    .nadiel-chat-mensaje-respuesta {
        padding: 6px 8px;
        margin-bottom: 6px;
    }

    .nadiel-chat-mensaje-respuesta-autor,
    .nadiel-chat-mensaje-respuesta-texto {
        font-size: 10.5px;
        line-height: 14px;
    }

}



/* =========================================================
   NADIEL - Resaltado temporal del mensaje original
   ========================================================= */

.nadiel-chat-mensaje-fila.nadiel-chat-mensaje-resaltado
.nadiel-chat-mensaje-burbuja {
    animation:
        nadielChatResaltarMensaje
        1.8s
        ease-out;
}

@keyframes nadielChatResaltarMensaje {

    0% {
        transform: scale(1);
        box-shadow:
            0 0 0 0
            rgba(59, 130, 246, 0);
    }

    18% {
        transform: scale(1.025);
        box-shadow:
            0 0 0 5px
            rgba(59, 130, 246, .20);
    }

    45% {
        transform: scale(1.015);
        box-shadow:
            0 0 0 3px
            rgba(59, 130, 246, .14);
    }

    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0
            rgba(59, 130, 246, 0);
    }

}


/*
 * La cita se comporta como elemento clickeable.
 */

.nadiel-chat-mensaje-respuesta {
    cursor: pointer;
    transition:
        opacity .15s ease,
        transform .15s ease;
}

.nadiel-chat-mensaje-respuesta:hover {
    opacity: .92;
}

.nadiel-chat-mensaje-respuesta:active {
    transform: scale(.985);
}

.nadiel-chat-mensaje-respuesta:focus-visible {
    outline: 2px solid rgba(59, 130, 246, .55);
    outline-offset: 2px;
}



/* =========================================================
   NADIEL - Resaltado mensaje original V2
   Más visible
   ========================================================= */

.nadiel-chat-mensaje-fila.nadiel-chat-mensaje-resaltado
.nadiel-chat-mensaje-burbuja {
    animation:
        nadielChatResaltarMensajeV2
        1.8s
        ease-out !important;
}

@keyframes nadielChatResaltarMensajeV2 {

    0% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(59, 130, 246, 0),
            0 0 0 rgba(59, 130, 246, 0);
    }

    15% {
        transform: scale(1.045);
        box-shadow:
            0 0 0 7px rgba(59, 130, 246, .38),
            0 0 22px rgba(59, 130, 246, .48);
    }

    35% {
        transform: scale(1.015);
        box-shadow:
            0 0 0 3px rgba(59, 130, 246, .18),
            0 0 10px rgba(59, 130, 246, .20);
    }

    52% {
        transform: scale(1.035);
        box-shadow:
            0 0 0 6px rgba(59, 130, 246, .30),
            0 0 18px rgba(59, 130, 246, .38);
    }

    75% {
        transform: scale(1.01);
        box-shadow:
            0 0 0 2px rgba(59, 130, 246, .12),
            0 0 8px rgba(59, 130, 246, .14);
    }

    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 rgba(59, 130, 246, 0),
            0 0 0 rgba(59, 130, 246, 0);
    }
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Reacciones rápidas
|--------------------------------------------------------------------------
*/

.nadiel-chat-reacciones-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(2px);
    transition:
        opacity .16s ease,
        transform .16s ease;
}

.nadiel-chat-mensaje-fila:hover
.nadiel-chat-reacciones-selector {
    opacity: 1;
    transform: translateY(0);
}

.nadiel-chat-reaccion-boton {
    width: 27px;
    height: 27px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    transition:
        transform .14s ease,
        box-shadow .14s ease,
        background .14s ease;
}

.nadiel-chat-reaccion-boton:hover {
    transform: translateY(-1px) scale(1.08);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .13);
}

.nadiel-chat-reacciones-activas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.nadiel-chat-reaccion-activa {
    min-height: 24px;
    padding: 2px 7px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 999px;
    background: rgba(248, 250, 252, .96);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    line-height: 1;
    transition:
        transform .14s ease,
        background .14s ease,
        border-color .14s ease;
}

.nadiel-chat-reaccion-activa:hover {
    transform: translateY(-1px);
    background: #ffffff;
}

.nadiel-chat-reaccion-activa small {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    opacity: .72;
}

.nadiel-chat-reaccion-propia {
    background: rgba(219, 234, 254, .95);
    border-color: rgba(59, 130, 246, .28);
}

@media (hover: none) {

    .nadiel-chat-reacciones-selector {
        opacity: 1;
        transform: none;
    }
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Buscador de conversación
|--------------------------------------------------------------------------
*/

.nadiel-chat-buscador {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(248, 250, 252, .98);
    border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.nadiel-chat-buscador[hidden] {
    display: none !important;
}

.nadiel-chat-buscador-campo {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    min-height: 36px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 10px;
    background: #ffffff;
}

.nadiel-chat-buscador-icono {
    flex: 0 0 auto;
    font-size: 13px;
    opacity: .58;
}

.nadiel-chat-buscador-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: #0f172a;
}

.nadiel-chat-buscador-input::placeholder {
    color: #94a3b8;
}

.nadiel-chat-buscador-contador {
    flex: 0 0 auto;
    min-width: 34px;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.nadiel-chat-buscador-acciones {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nadiel-chat-buscador-nav,
.nadiel-chat-buscador-cerrar {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .09);
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    transition:
        background .14s ease,
        transform .14s ease;
}

.nadiel-chat-buscador-nav:hover,
.nadiel-chat-buscador-cerrar:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.nadiel-chat-buscador-nav:disabled {
    opacity: .35;
    cursor: default;
    transform: none;
}

.nadiel-chat-mensaje-coincidencia
.nadiel-chat-mensaje-burbuja {
    box-shadow:
        0 0 0 2px rgba(250, 204, 21, .45),
        0 3px 12px rgba(15, 23, 42, .08);
}

.nadiel-chat-mensaje-coincidencia-activa
.nadiel-chat-mensaje-burbuja {
    box-shadow:
        0 0 0 3px rgba(245, 158, 11, .70),
        0 0 18px rgba(245, 158, 11, .22);
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Reacciones V2
| No comprimir burbujas ni adjuntos PDF
|--------------------------------------------------------------------------
*/

.nadiel-chat-mensaje-fila {
    position: relative;
}

.nadiel-chat-reacciones-selector {
    position: absolute;
    z-index: 6;

    top: 50%;
    transform: translateY(-50%);

    width: max-content;

    pointer-events: none;
}

/* Mensaje recibido: selector a la derecha de la burbuja */
.nadiel-chat-mensaje-ajeno
.nadiel-chat-reacciones-selector {
    left: calc(78% + 8px);
}

/* Mensaje propio: selector a la izquierda de la burbuja */
.nadiel-chat-mensaje-propio
.nadiel-chat-reacciones-selector {
    right: calc(78% + 8px);
}

.nadiel-chat-mensaje-fila:hover
.nadiel-chat-reacciones-selector {
    opacity: 1;
    transform: translateY(-50%);
    pointer-events: auto;
}


/*
 * Los adjuntos deben conservar todo el ancho disponible
 * dentro de la burbuja.
 */

.nadiel-chat-adjunto {
    width: 100%;
    min-width: 0;
}

.nadiel-chat-adjunto-info {
    width: 100%;
    box-sizing: border-box;
}

.nadiel-chat-adjunto-descargar {
    position: relative;
    z-index: 2;
    pointer-events: auto;
}


/*
 * En dispositivos táctiles no dejamos cuatro emojis
 * ocupando permanentemente espacio alrededor del PDF.
 */

@media (hover: none) {

    .nadiel-chat-reacciones-selector {
        opacity: 0;
        pointer-events: none;
    }
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Mensajes fijados
|--------------------------------------------------------------------------
*/

/*
 * El botón está fuera del flujo FLEX para no reducir
 * el ancho de la burbuja ni de los adjuntos.
 */

.nadiel-chat-fijar-boton {
    position: absolute;
    z-index: 7;

    top: 4px;

    width: 27px;
    height: 27px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 8px;

    background: rgba(255, 255, 255, .94);

    box-shadow:
        0 2px 7px rgba(15, 23, 42, .12);

    font-size: 13px;
    line-height: 1;

    cursor: pointer;

    opacity: 0;

    transform: scale(.92);

    transition:
        opacity .15s ease,
        transform .15s ease,
        background .15s ease;

    pointer-events: none;
}


/* Recibido: controles al lado derecho de la burbuja */

.nadiel-chat-mensaje-ajeno
.nadiel-chat-fijar-boton {
    left: calc(78% + 8px);
}


/* Propio: controles al lado izquierdo */

.nadiel-chat-mensaje-propio
.nadiel-chat-fijar-boton {
    right: calc(78% + 8px);
}


.nadiel-chat-mensaje-fila:hover
.nadiel-chat-fijar-boton {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}


.nadiel-chat-fijar-boton:hover {
    background: #fef3c7;
}


/*
 * Si el mensaje ya está fijado, el pin permanece visible.
 */

.nadiel-chat-fijar-boton-activo {
    opacity: 1;
    transform: scale(1);

    background: #fef3c7;

    pointer-events: auto;
}


/*
 * Indicador sutil sobre la propia burbuja.
 */

.nadiel-chat-mensaje-fila:has(
    .nadiel-chat-fijar-boton-activo
)
.nadiel-chat-mensaje-burbuja {
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, .20);
}


/*
 * En táctil mostramos únicamente los fijados.
 * Los no fijados los manejaremos después desde el menú.
 */

@media (hover: none) {

    .nadiel-chat-fijar-boton {
        opacity: 0;
        pointer-events: none;
    }

    .nadiel-chat-fijar-boton-activo {
        opacity: 1;
        pointer-events: auto;
    }
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Controles de mensaje V3
| Corrige posicion de reaccion, fijar y responder
|--------------------------------------------------------------------------
*/

/*
 * La fila vuelve a administrar los controles pequeños.
 * El pin deja de usar posiciones calculadas con 78%.
 */

.nadiel-chat-mensaje-fila {
    position: relative;
    gap: 4px !important;
}


/*
|--------------------------------------------------------------------------
| PIN
|--------------------------------------------------------------------------
*/

.nadiel-chat-fijar-boton {
    position: static !important;

    flex: 0 0 27px;

    width: 27px;
    height: 27px;

    opacity: 0;

    transform: scale(.92);

    pointer-events: none;
}


/* Mensaje recibido: burbuja -> responder -> pin */

.nadiel-chat-mensaje-ajeno
.nadiel-chat-mensaje-burbuja {
    order: 1;
}

.nadiel-chat-mensaje-ajeno
.nadiel-chat-responder-boton {
    order: 2;
}

.nadiel-chat-mensaje-ajeno
.nadiel-chat-fijar-boton {
    order: 3;
}


/* Mensaje propio: pin -> responder -> burbuja */

.nadiel-chat-mensaje-propio
.nadiel-chat-fijar-boton {
    order: 1;
}

.nadiel-chat-mensaje-propio
.nadiel-chat-responder-boton {
    order: 2;
}

.nadiel-chat-mensaje-propio
.nadiel-chat-mensaje-burbuja {
    order: 3;
}


.nadiel-chat-mensaje-fila:hover
.nadiel-chat-fijar-boton {
    opacity: .72;
    transform: scale(1);
    pointer-events: auto;
}

.nadiel-chat-fijar-boton:hover,
.nadiel-chat-fijar-boton-activo {
    opacity: 1 !important;
    transform: scale(1);
    pointer-events: auto;
}


/*
|--------------------------------------------------------------------------
| REACCIONES
|--------------------------------------------------------------------------
|
| Se muestran como una bandeja flotante DENTRO de la fila.
| Ya no utilizamos el ancho máximo de la burbuja para ubicarlas.
|
*/

.nadiel-chat-reacciones-selector {
    position: absolute !important;

    top: 100% !important;
    bottom: auto !important;

    z-index: 20;

    width: max-content;
    max-width: calc(100% - 16px);

    padding: 4px;

    border-radius: 10px;

    background: rgba(255, 255, 255, .98);

    box-shadow:
        0 5px 18px rgba(15, 23, 42, .16);

    transform: translateY(-7px) !important;

    pointer-events: none;
}


/* Recibidos: bandeja desde la izquierda */

.nadiel-chat-mensaje-ajeno
.nadiel-chat-reacciones-selector {
    left: 8px !important;
    right: auto !important;
}


/* Propios: bandeja desde la derecha */

.nadiel-chat-mensaje-propio
.nadiel-chat-reacciones-selector {
    right: 8px !important;
    left: auto !important;
}


.nadiel-chat-mensaje-fila:hover
.nadiel-chat-reacciones-selector {
    opacity: 1;
    transform: translateY(-3px) !important;
    pointer-events: auto;
}


/*
 * Los botones de reacción no deben crecer ni salirse.
 */

.nadiel-chat-reaccion-boton {
    flex: 0 0 auto;
}


/*
|--------------------------------------------------------------------------
| MOVIL / TACTIL
|--------------------------------------------------------------------------
*/

@media (hover: none) {

    .nadiel-chat-reacciones-selector {
        display: none !important;
    }

    .nadiel-chat-fijar-boton:not(
        .nadiel-chat-fijar-boton-activo
    ) {
        display: none;
    }

    .nadiel-chat-fijar-boton-activo {
        display: flex;
        opacity: 1;
        pointer-events: auto;
    }
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Panel de mensajes fijados
|--------------------------------------------------------------------------
*/

.nadiel-chat-fijados {
    border-bottom:
        1px solid rgba(15, 23, 42, .08);

    background:
        rgba(255, 251, 235, .96);

    padding:
        7px 9px 8px;
}


.nadiel-chat-fijados[hidden] {
    display: none !important;
}


.nadiel-chat-fijados-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    margin-bottom: 6px;
}


.nadiel-chat-fijados-titulo {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 6px;

    color: #92400e;

    font-size: 11px;
}


.nadiel-chat-fijados-titulo strong {
    font-size: 11px;
    font-weight: 700;
}


.nadiel-chat-fijados-contador {
    min-width: 18px;
    height: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 5px;

    border-radius: 999px;

    background:
        rgba(245, 158, 11, .14);

    color: #92400e;

    font-size: 9px;
    font-weight: 700;
}


.nadiel-chat-fijados-cerrar {
    flex: 0 0 24px;

    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 7px;

    background: transparent;

    color: #92400e;

    font-size: 17px;
    line-height: 1;

    cursor: pointer;
}


.nadiel-chat-fijados-cerrar:hover {
    background:
        rgba(245, 158, 11, .12);
}


.nadiel-chat-fijados-lista {
    display: flex;
    flex-direction: column;

    gap: 5px;

    max-height: 110px;

    overflow-y: auto;
}


.nadiel-chat-fijado-item {
    display: flex;
    align-items: center;

    gap: 7px;

    width: 100%;

    padding: 7px 8px;

    border:
        1px solid rgba(245, 158, 11, .16);

    border-radius: 9px;

    background:
        rgba(255, 255, 255, .78);

    color: #334155;

    text-align: left;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}


.nadiel-chat-fijado-item:hover {
    background: #ffffff;

    border-color:
        rgba(245, 158, 11, .32);

    transform:
        translateY(-1px);
}


.nadiel-chat-fijado-item-icono {
    flex: 0 0 auto;

    font-size: 11px;
}


.nadiel-chat-fijado-item-copy {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 1px;
}


.nadiel-chat-fijado-item-copy strong {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 10px;
    font-weight: 700;

    color: #78350f;
}


.nadiel-chat-fijado-item-copy span {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 10px;

    color: #475569;
}


.nadiel-chat-fijado-item-hora {
    flex: 0 0 auto;

    font-size: 8px;

    color: #94a3b8;
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Separadores de fecha
|--------------------------------------------------------------------------
*/

.nadiel-chat-separador-fecha {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 8px;

    margin:
        12px 0 9px;

    color: #64748b;

    font-size: 10px;
    font-weight: 600;

    line-height: 1;
}


.nadiel-chat-separador-fecha::before,
.nadiel-chat-separador-fecha::after {
    content: '';

    flex: 1;

    height: 1px;

    background:
        rgba(148, 163, 184, .22);
}


.nadiel-chat-separador-fecha span {
    flex: 0 0 auto;

    padding:
        4px 9px;

    border-radius: 999px;

    background:
        rgba(248, 250, 252, .96);

    border:
        1px solid rgba(148, 163, 184, .15);

    color: #64748b;

    box-shadow:
        0 1px 3px rgba(15, 23, 42, .04);
}


/*
 * El primer separador necesita menos espacio superior.
 */

.nadiel-chat-mensajes
.nadiel-chat-separador-fecha:first-child {
    margin-top: 3px;
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Separador de fecha flotante
|--------------------------------------------------------------------------
*/

.nadiel-chat-separador-fecha {
    position: sticky;

    top: 6px;

    z-index: 12;

    width: 100%;

    pointer-events: none;
}


.nadiel-chat-separador-fecha span {
    pointer-events: auto;

    background:
        rgba(248, 250, 252, .96);

    backdrop-filter:
        blur(8px);

    -webkit-backdrop-filter:
        blur(8px);

    box-shadow:
        0 2px 8px rgba(15, 23, 42, .08);
}


/*
 * Evitamos que las lineas laterales se vean
 * mientras la fecha queda flotando.
 */

.nadiel-chat-separador-fecha::before,
.nadiel-chat-separador-fecha::after {
    opacity: .38;
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Fecha flotante V2
|--------------------------------------------------------------------------
*/

.nadiel-chat-separador-fecha {
    position: sticky !important;

    top: 8px !important;

    z-index: 30 !important;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;

    margin:
        10px 0 8px !important;

    pointer-events: none;
}


/*
 * Quitamos las líneas laterales.
 * En modo flotante generan ruido visual.
 */

.nadiel-chat-separador-fecha::before,
.nadiel-chat-separador-fecha::after {
    display: none !important;
}


/*
 * Pastilla flotante.
 */

.nadiel-chat-separador-fecha span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    max-width: 80%;

    min-height: 24px;

    padding:
        4px 11px !important;

    border:
        1px solid rgba(148, 163, 184, .20);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, .98) !important;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;

    line-height: 14px;

    white-space: nowrap;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, .12);

    backdrop-filter:
        blur(10px);

    -webkit-backdrop-filter:
        blur(10px);

    pointer-events: none;
}


/*
 * Cuando el separador queda arriba,
 * mantiene espacio visual respecto de las burbujas.
 */

.nadiel-chat-mensajes
.nadiel-chat-separador-fecha:first-child {
    margin-top: 4px !important;
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Preparación fecha flotante única
|--------------------------------------------------------------------------
|
| Los separadores siguen existiendo dentro de la conversación,
| pero dejan de ser sticky individualmente.
|
*/

.nadiel-chat-separador-fecha {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;

    margin:
        10px 0 8px !important;
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Fecha flotante única
|--------------------------------------------------------------------------
*/

.nadiel-chat-fecha-flotante {
    position: absolute;

    top: 74px;

    left: 50%;

    transform:
        translateX(-50%);

    z-index: 50;

    pointer-events: none;
}


.nadiel-chat-fecha-flotante[hidden] {
    display: none !important;
}


.nadiel-chat-fecha-flotante span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 24px;

    padding:
        4px 11px;

    border-radius: 999px;

    border:
        1px solid rgba(148, 163, 184, .20);

    background:
        rgba(255, 255, 255, .98);

    color: #64748b;

    font-size: 10px;
    font-weight: 700;

    line-height: 14px;

    white-space: nowrap;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, .12);

    backdrop-filter:
        blur(10px);

    -webkit-backdrop-filter:
        blur(10px);
}


/*
 * En modo compacto ajustamos la altura
 * del encabezado del chat.
 */

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-fecha-flotante {
    top: 64px;
}


/*
 * En móvil dejamos un poco más de espacio.
 */

@media (max-width: 600px) {

    .nadiel-chat-fecha-flotante {
        top: 66px;
    }
}



/*
|--------------------------------------------------------------------------
| Crear pendiente desde chat
|--------------------------------------------------------------------------
*/

.nadiel-chat-pendiente-boton {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px 5px;
    border-radius: 7px;
    font-size: 15px;
    line-height: 1;
    opacity: .72;
}

.nadiel-chat-pendiente-boton:hover {
    background: rgba(15, 23, 42, .08);
    opacity: 1;
}

.nadiel-chat-pendiente-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(3px);
}

.nadiel-chat-pendiente-modal {
    width: min(560px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow:
        0 24px 70px
        rgba(15, 23, 42, .26);
}

.nadiel-chat-pendiente-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.nadiel-chat-pendiente-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
}

.nadiel-chat-pendiente-header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
}

.nadiel-chat-pendiente-cerrar {
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
}

.nadiel-chat-pendiente-cuerpo {
    display: grid;
    gap: 15px;
    padding: 20px 22px;
}

.nadiel-chat-pendiente-campo {
    display: grid;
    gap: 7px;
}

.nadiel-chat-pendiente-campo > span {
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.nadiel-chat-pendiente-campo input,
.nadiel-chat-pendiente-campo select,
.nadiel-chat-pendiente-campo textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
    color: #0f172a;
    font: inherit;
}

.nadiel-chat-pendiente-campo textarea {
    min-height: 90px;
    resize: vertical;
}

.nadiel-chat-pendiente-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.nadiel-chat-pendiente-aviso {
    padding: 11px 13px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.5;
}

.nadiel-chat-pendiente-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px 20px;
    border-top: 1px solid #e2e8f0;
}

.nadiel-chat-pendiente-cancelar,
.nadiel-chat-pendiente-guardar {
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.nadiel-chat-pendiente-cancelar {
    background: #f1f5f9;
    color: #334155;
}

.nadiel-chat-pendiente-guardar {
    background: #0f172a;
    color: #fff;
}

.nadiel-chat-pendiente-guardar:disabled {
    cursor: not-allowed;
    opacity: .45;
}

@media (max-width: 640px) {

    .nadiel-chat-pendiente-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .nadiel-chat-pendiente-modal {
        width: 100%;
        max-height: 90vh;
        border-radius: 18px 18px 0 0;
    }

    .nadiel-chat-pendiente-grid {
        grid-template-columns: 1fr;
    }
}


/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Indicador de pendiente V2
|--------------------------------------------------------------------------
*/

/*
 * Botón normal para crear pendiente.
 */
.nadiel-chat-pendiente-boton {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    min-width: 26px;
    height: 26px;
    padding: 0 5px;

    border: 1px solid transparent;
    border-radius: 8px;

    background: transparent;

    line-height: 1;
    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.nadiel-chat-pendiente-boton:hover {
    background: rgba(15, 23, 42, 0.06);
}

.nadiel-chat-pendiente-boton:active {
    transform: scale(0.94);
}


/*
 * Pendiente ya creado.
 *
 * Se transforma en un badge compacto en vez de parecer
 * otro botón de acción.
 */
.nadiel-chat-pendiente-boton.nadiel-chat-pendiente-boton-activo {
    width: auto;
    min-width: 42px;
    height: 24px;

    padding: 0 7px;

    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: 999px;

    background: rgba(22, 163, 74, 0.10);

    color: #15803d;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.15px;

    white-space: nowrap;
    word-break: normal;

    cursor: default;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04);
}


/*
 * El badge activo no debe comportarse visualmente
 * como un botón clickeable.
 */
.nadiel-chat-pendiente-boton.nadiel-chat-pendiente-boton-activo:hover {
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.22);

    transform: none;
}

.nadiel-chat-pendiente-boton.nadiel-chat-pendiente-boton-activo:active {
    transform: none;
}


/*
 * Mantener las acciones del mensaje alineadas.
 */
.nadiel-chat-mensaje-acciones {
    align-items: center;
    gap: 3px;
}


/*
 * Optimización para pantallas pequeñas.
 */
@media (max-width: 600px) {

    .nadiel-chat-pendiente-boton.nadiel-chat-pendiente-boton-activo {
        min-width: 40px;
        height: 23px;
        padding: 0 6px;
        font-size: 10.5px;
    }
}



/*
|--------------------------------------------------------------------------
| NADIEL CHAT - Adjuntos compactos V2
|--------------------------------------------------------------------------
|
| PDF, Word, Excel y otros documentos.
| Las imágenes mantienen su comportamiento actual.
|
*/

.nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen)) {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 2px 0 !important;
}


/*
 * Una sola fila compacta:
 *
 * [icono] [nombre / PDF · tamaño] [ver] [descargar]
 */
.nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
.nadiel-chat-adjunto-info {
    display: flex !important;
    align-items: center !important;

    width: 100% !important;
    min-width: 0 !important;

    gap: 5px !important;

    padding: 7px 7px !important;

    border-radius: 9px !important;

    box-sizing: border-box !important;
}


/*
 * Icono del documento.
 */
.nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
.nadiel-chat-adjunto-icono {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    flex: 0 0 28px !important;

    width: 28px !important;
    height: 28px !important;

    font-size: 17px !important;
    line-height: 1 !important;
}


/*
 * Zona de nombre y tamaño.
 *
 * min-width:0 permite el ellipsis correctamente
 * en vez de partir PDF / KB letra por letra.
 */
.nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
.nadiel-chat-adjunto-copy {
    flex: 1 1 auto !important;

    min-width: 0 !important;
    width: 0 !important;

    overflow: hidden !important;
}


/*
 * Nombre del archivo.
 */
.nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
.nadiel-chat-adjunto-copy strong {
    display: block !important;

    width: 100% !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;

    word-break: normal !important;
    overflow-wrap: normal !important;

    font-size: 10.5px !important;
    line-height: 1.25 !important;
}


/*
 * PDF · 99.5 KB
 */
.nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
.nadiel-chat-adjunto-copy small {
    display: block !important;

    margin-top: 2px !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;

    word-break: normal !important;
    overflow-wrap: normal !important;

    font-size: 8.5px !important;
    line-height: 1.2 !important;
}


/*
 * Botones abrir / descargar.
 */
.nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
.nadiel-chat-adjunto-descargar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    flex: 0 0 25px !important;

    width: 25px !important;
    height: 25px !important;

    padding: 0 !important;

    border-radius: 7px !important;

    font-size: 12px !important;
    line-height: 1 !important;
}


/*
 * En móvil lo compactamos un poco más.
 */
@media (max-width: 600px) {

    .nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
    .nadiel-chat-adjunto-info {
        gap: 3px !important;
        padding: 6px !important;
    }

    .nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
    .nadiel-chat-adjunto-icono {
        flex-basis: 25px !important;

        width: 25px !important;
        height: 25px !important;

        font-size: 15px !important;
    }

    .nadiel-chat-adjunto:not(:has(.nadiel-chat-adjunto-imagen))
    .nadiel-chat-adjunto-descargar {
        flex-basis: 23px !important;

        width: 23px !important;
        height: 23px !important;

        font-size: 11px !important;
    }
}



/* =========================================================
   NADIEL CHAT - Corrección estructural V6
   Evita desbordamientos y compositor cortado
   ========================================================= */

/*
 * La ventana completa funciona como columna.
 * Así dejamos de depender del cálculo manual de alturas.
 */
.nadiel-chat-ventana {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}


/*
 * Cabecera.
 */
.nadiel-chat-header {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.nadiel-chat-identidad {
    min-width: 0 !important;
    overflow: hidden !important;
}

.nadiel-chat-identidad > div {
    min-width: 0 !important;
    overflow: hidden !important;
}

.nadiel-chat-identidad strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}


/*
 * Zona central.
 *
 * IMPORTANTE:
 * anulamos los height: calc(...) de versiones anteriores.
 */
.nadiel-chat-mensajes,
.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-mensajes {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;
}


/*
 * Ninguna burbuja puede ensanchar la ventana.
 */
.nadiel-chat-mensaje,
.nadiel-chat-mensaje-fila,
.nadiel-chat-burbuja {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}


/*
 * Textos largos, URLs o cadenas sin espacios.
 */
.nadiel-chat-burbuja,
.nadiel-chat-mensaje-texto {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}


/*
 * Indicador "está escribiendo".
 * Debe ocupar su propia franja y nunca salirse.
 */
.nadiel-chat-escribiendo {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.nadiel-chat-escribiendo-texto {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}


/*
 * Compositor.
 */
.nadiel-chat-formulario,
.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-formulario {
    position: relative !important;

    flex: 0 0 auto !important;

    width: 100% !important;
    min-width: 0 !important;

    box-sizing: border-box !important;

    height: auto !important;
    min-height: 60px !important;

    overflow: visible !important;
}


/*
 * El textarea absorbe únicamente el espacio disponible.
 */
.nadiel-chat-formulario textarea,
.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-formulario textarea {
    flex: 1 1 auto !important;

    width: auto !important;
    min-width: 0 !important;

    box-sizing: border-box !important;

    resize: none !important;
}


/*
 * Emoji y enviar nunca aplastan el textarea.
 */
.nadiel-chat-formulario
.nadiel-chat-emoji-contenedor {
    flex: 0 0 auto !important;
}

.nadiel-chat-formulario
.nadiel-chat-emoji-boton,
.nadiel-chat-formulario
button[type="submit"] {
    flex-shrink: 0 !important;
}


/*
 * Móvil.
 */
@media (max-width: 600px) {

    .nadiel-chat-ventana,
    .nadiel-chat-ventana.nadiel-chat-compacto {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .nadiel-chat-mensajes,
    .nadiel-chat-ventana.nadiel-chat-compacto
    .nadiel-chat-mensajes {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .nadiel-chat-formulario,
    .nadiel-chat-ventana.nadiel-chat-compacto
    .nadiel-chat-formulario {
        flex: 0 0 auto !important;

        width: 100% !important;

        height: auto !important;
        min-height: 58px !important;

        padding:
            7px 8px
            calc(
                7px
                + env(
                    safe-area-inset-bottom,
                    0px
                )
            ) !important;
    }

    .nadiel-chat-formulario textarea,
    .nadiel-chat-ventana.nadiel-chat-compacto
    .nadiel-chat-formulario textarea {
        min-width: 0 !important;

        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;

        font-size: 16px !important;
    }
}


/* =========================================================
   NADIEL CHAT - Metadatos de mensajes V3
   Fecha, hora y estado siempre dentro de la burbuja
   ========================================================= */

.nadiel-chat-mensaje-meta {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;

    box-sizing: border-box !important;

    margin-top: 5px !important;
    padding: 0 !important;

    text-align: right !important;

    /*
     * Permitimos adaptación si la burbuja es estrecha.
     */
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;

    font-size: 10px !important;
    line-height: 1.25 !important;
    font-weight: 500 !important;

    opacity: .72 !important;
}


/*
 * En mensajes propios damos un poco más de espacio
 * para fecha + hora + estado de lectura.
 */
.nadiel-chat-mensaje-propio
.nadiel-chat-burbuja {
    min-width: 0 !important;
}


/*
 * En móvil lo hacemos ligeramente más compacto.
 */
@media (max-width: 600px) {

    #nadielChatVentana
    .nadiel-chat-mensaje-meta {
        font-size: 9px !important;
        line-height: 1.25 !important;
    }
}


/* =========================================================
   NADIEL CHAT - Metadatos propios en una sola línea V4
   ========================================================= */

/*
 * Solo las burbujas enviadas por nosotros necesitan
 * un ancho mínimo para fecha + hora + estado.
 */
.nadiel-chat-mensaje-propio
.nadiel-chat-burbuja {
    min-width: 158px !important;
}


/*
 * Fecha + hora + ✓✓ Leído permanecen juntos.
 */
.nadiel-chat-mensaje-propio
.nadiel-chat-mensaje-meta {
    white-space: nowrap !important;
    overflow: visible !important;

    font-size: 9px !important;
    line-height: 1.2 !important;

    text-align: right !important;
}


/*
 * En pantallas muy pequeñas permitimos reducir
 * ligeramente el ancho mínimo.
 */
@media (max-width: 600px) {

    .nadiel-chat-mensaje-propio
    .nadiel-chat-burbuja {
        min-width: 150px !important;
    }

    #nadielChatVentana
    .nadiel-chat-mensaje-propio
    .nadiel-chat-mensaje-meta {
        font-size: 8.5px !important;
    }
}


/* =========================================================
   NADIEL CHAT - Cabecera adaptable V7
   Identidad + acciones arriba / reloj abajo
   ========================================================= */

.nadiel-chat-header {
    position: relative !important;

    display: flex !important;
    align-items: flex-start !important;

    min-width: 0 !important;

    height: 72px !important;

    padding:
        9px
        10px
        20px
        12px !important;

    gap: 6px !important;

    box-sizing: border-box !important;
}


/* Identidad del usuario */

.nadiel-chat-identidad {
    flex: 1 1 auto !important;

    min-width: 0 !important;

    overflow: hidden !important;
}

.nadiel-chat-identidad > div:last-child {
    flex: 1 1 auto !important;

    min-width: 0 !important;

    overflow: hidden !important;
}

.nadiel-chat-identidad strong {
    display: block !important;

    max-width: 100% !important;

    overflow: hidden !important;

    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}


/* Botones de la derecha */

.nadiel-chat-header-acciones {
    flex: 0 0 auto !important;

    display: flex !important;
    align-items: center !important;

    gap: 2px !important;

    white-space: nowrap !important;
}

.nadiel-chat-header-acciones
.nadiel-chat-icon-button {
    flex: 0 0 28px !important;

    width: 28px !important;
    height: 28px !important;

    font-size: 14px !important;
}


/* Reloj Chile:
   ocupa su propia línea inferior */

.nadiel-chat-hora-chile {
    position: absolute !important;

    left: 63px !important;
    right: 10px !important;
    bottom: 5px !important;

    min-width: 0 !important;

    overflow: hidden !important;

    white-space: nowrap !important;
    text-overflow: ellipsis !important;

    color: #64748b !important;

    font-size: 9.5px !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;

    text-align: left !important;
}


/* =========================================================
   MODO COMPACTO
   ========================================================= */

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-header {
    height: 68px !important;

    padding:
        8px
        8px
        19px
        10px !important;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-header-acciones {
    gap: 1px !important;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-header-acciones
.nadiel-chat-icon-button {
    flex-basis: 26px !important;

    width: 26px !important;
    height: 26px !important;

    font-size: 13px !important;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-hora-chile {
    left: 55px !important;
    right: 8px !important;
    bottom: 4px !important;

    font-size: 9px !important;
}


/* =========================================================
   NADIEL CHAT - Ajuste fino reloj V8
   ========================================================= */

.nadiel-chat-hora-chile {
    bottom: 3px !important;
}

.nadiel-chat-ventana.nadiel-chat-compacto
.nadiel-chat-hora-chile {
    bottom: 2px !important;
}
