.dy-label{
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dy-heading);
}

.dy-label-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.dy-label-row .dy-label{
    margin-bottom: 0;
}

.dy-input-wrap{
    position: relative;
}

.dy-input-wrap-password{
    position: relative;
}

.dy-input,
.dy-select{
    width: 100%;
    height: 44px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    background: #fff;
    color: #0f172a;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .18s ease;
    box-shadow: none;
}

.dy-input{
    height: 52px;
    padding: 0 16px;
    border: 1px solid #d7deea;
    border-radius: var(--dy-radius-lg);
    background: #f7fbff;
    color: var(--dy-heading);
    font-size: 16px;
}

.dy-input::placeholder{
    color: #97a3b6;
}

.dy-input:hover{
    border-color: #c9d4e4;
    background: #f9fbff;
}

.dy-input:focus,
.dy-select:focus{
    background: #ffffff;
    border-color: #437EA6;
    box-shadow: 0 0 0 3px rgba(67,126,166,.18);
}

.dy-input.is-error{
    border-color: var(--dy-danger);
    box-shadow: 0 0 0 3px rgba(214,69,69,.10);
}

.dy-select{
    min-width: 190px;
}

.dy-btn{
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 14px 14px 6px 14px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}

.dy-btn:active{
    transform: translateY(1px);
}

/* =========================
   PRIMARY DOCYA
========================= */
.dy-btn-primary{
    background: linear-gradient(135deg, #2F5F7C, #437EA6);
    color: #fff;
    box-shadow: 0 12px 28px rgba(47,95,124,.35);
    letter-spacing: 1.25px;
}

.dy-btn-primary:hover{
    background: linear-gradient(135deg, #437EA6, #5b9bc6);
    transform: translateY(-1px);
}

.dy-btn-primary:active{
    background: linear-gradient(135deg, #274E66, #315e7b);
    transform: translateY(1px);
}

.dy-btn-primary:disabled{
    background: #9FC2DD;
    cursor: not-allowed;
    box-shadow: none;
    opacity: .9;
}

.dy-btn-ghost{
    width: auto;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all .2s ease;
}

.dy-btn-ghost:hover{
    border-color: #437EA6;
    color: #437EA6;
    background: rgba(67,126,166,.05);
}

.dy-error{
    margin-top: 8px;
    font-size: 12px;
    color: var(--dy-danger);
    font-weight: 600;
}

.dy-link{
    font-size: 14px;
    color: var(--dy-primary-500);
}

.dy-link:hover{
    color: var(--dy-primary-600);
}

.dy-alert{
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--dy-radius-md);
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.dy-alert-success{
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.dy-alert-error{
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.dy-password-toggle{
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #98a2b3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.dy-input-wrap-password .dy-input{
    padding-right: 48px;
}

.dy-password-toggle:hover{
    color: #667085;
}

.dy-password-toggle svg{
    width: 20px;
    height: 20px;
}

.dy-password-toggle::after{
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    right: 50%;
    transform: translateX(50%) translateY(6px);
    background: #111827;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 20;
}

.dy-password-toggle::before{
    content: "";
    position: absolute;
    bottom: 118%;
    right: 50%;
    transform: translateX(50%) translateY(6px);
    border-width: 6px;
    border-style: solid;
    border-color: #111827 transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 20;
}

.dy-password-toggle:hover::after,
.dy-password-toggle:hover::before,
.dy-password-toggle:focus::after,
.dy-password-toggle:focus::before,
.dy-password-toggle:active::after,
.dy-password-toggle:active::before{
    opacity: 1;
    transform: translateX(50%) translateY(0);
}

.dy-view-shell{
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dy-view-header{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.dy-view-title-block{
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dy-view-title{
    margin: 0;
    font-size: 38px;
    line-height: 1.05;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.02em;
}

.dy-view-subtitle{
    margin: 0;
    font-size: 18px;
    color: #64748b;
    line-height: 1.35;
}

.dy-view-header-actions{
    display: flex;
    align-items: center;
    gap: 10px;
}

.dy-btn-with-shortcut{
    width: auto;
    min-width: 220px;
    height: 46px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    
}

.dy-btn-icon-leading{
    font-size: 18px;
    line-height: 1;
    font-weight: 800;
}

.dy-shortcut-key{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
}

.dy-toolbar-card{
    background: #ffffff;
    border: 1px solid #e8edf3;
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .04);
}

.dy-toolbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.dy-toolbar-left,
.dy-toolbar-right{
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dy-search-box{
    position: relative;
    min-width: 360px;
}

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

.dy-search-input{
    width: 100%;
    padding-left: 40px;
}

.dy-table-card{
    padding: 18px 18px 10px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #e8edf3;
    box-shadow: 0 10px 35px rgba(15, 23, 42, .05);
}

.dy-table-headbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dy-table-headbar-left{
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dy-table-title{
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.dy-table-count{
    font-size: 13px;
    color: #64748b;
}

.dy-table-wrap{
    overflow-x: auto;
}

.dy-table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.dy-table thead th{
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    padding: 14px 12px;
    border-bottom: 1px solid #e8edf3;
    background: #f8fafc;
}

.dy-table tbody td{
    padding: 14px 12px;
    border-bottom: 1px solid #eef2f7;
    color: #0f172a;
    font-size: 15px;
    vertical-align: middle;
}

.dy-table tbody tr:hover{
    background: #fafcff;
}

.dy-col-id,
.dy-cell-id{
    width: 72px;
}

.dy-col-actions{
    width: 130px;
    text-align: center;
}

.dy-person-name{
    font-weight: 600;
    color: #0f172a;
}

.dy-cell-email{
    color: #334155;
}

.dy-actions-cell{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dy-btn-icon{
    width: 36px;
    height: 36px;
    border: 1px solid #dde6ef;
    border-radius: 12px;
    background: #f8fafc;
    color: #5b6b7f;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
}

.dy-btn-icon:hover{
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15,23,42,.08);
}

.dy-btn-icon-edit:hover{
    color: #437EA6;
    border-color: rgba(67,126,166,.30);
    background: rgba(67,126,166,.08);
}

.dy-btn-icon-delete:hover{
    color: #b42318;
    border-color: rgba(180,35,24,.22);
    background: rgba(180,35,24,.08);
}

.dy-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.dy-badge-success{
    background: #dff7e8;
    color: #16794c;
}

/* compatibilidad con ambos nombres */
.dy-badge-off,
.dy-badge-danger{
    background: #fde8e8;
    color: #b42318;
}

.dy-table-footer{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 4px 4px;
    flex-wrap: wrap;
}

.dy-table-footer-left{
    font-size: 14px;
    color: #64748b;
}

.dy-table-footer-right{
    display: flex;
    align-items: center;
    gap: 8px;
}

.dy-page-btn{
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #dbe4ee;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font-weight: 600;
}

.dy-page-btn.is-active{
    background: #437EA6;
    color: #fff;
    border-color: #437EA6;
}

.dy-page-btn:disabled{
    opacity: .5;
    cursor: not-allowed;
}

.dy-empty-state{
    padding: 36px 20px;
    text-align: center;
}

.dy-empty-state-title{
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.dy-empty-state-text{
    font-size: 14px;
    color: #64748b;
}

@media (max-width: 900px){
    .dy-view-header{
        flex-direction: column;
        align-items: stretch;
    }

    .dy-view-header-actions{
        width: 100%;
    }

    .dy-btn-with-shortcut{
        width: 100%;
    }

    .dy-search-box{
        min-width: 100%;
    }
}

.dy-badge.dy-badge-success{
    background: #dff7e8 !important;
    color: #16794c !important;
    border-radius: 999px !important;
    padding: 0 12px !important;
    min-height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.dy-badge.dy-badge-danger,
.dy-badge.dy-badge-off{
    background: #fde8e8 !important;
    color: #b42318 !important;
    border-radius: 999px !important;
    padding: 0 12px !important;
    min-height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.dy-btn-accent{
    background: linear-gradient(135deg, #437EA6, #5b9bc6);
    color: #fff;
    box-shadow: 0 10px 24px rgba(67,126,166,0.25);
}

/* ===== DocYa Global Modal Layout ===== */

.dy-modal.is-open,
.dy-paciente-modal.is-open,
.dy-proveedor-modal.is-open,
.dy-producto-modal.is-open,
.dy-compra-modal.is-open,
.dy-medico-modal.is-open,
.dy-cajero-modal.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 28px 18px;
    overscroll-behavior: contain;
}

.dy-modal-dialog,
.dy-paciente-dialog,
.dy-proveedor-dialog,
.dy-producto-dialog,
.dy-compra-dialog,
.dy-medico-dialog,
.dy-cajero-dialog {
    max-height: calc(100vh - 56px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-gutter: stable;
}

.dy-modal-dialog.dy-modal-dialog--sm {
    width: min(480px, calc(100vw - 32px));
    max-width: 480px;
}

.dy-form-error {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #b91c1c;
}

.dy-modal-body,
.dy-paciente-form-grid,
.dy-proveedor-form-grid,
.dy-producto-form-grid,
.dy-compra-form-grid,
.dy-medico-form-grid,
.dy-cajero-form-grid {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.dy-modal-footer,
.dy-paciente-modal-actions,
.dy-proveedor-modal-actions,
.dy-producto-modal-actions,
.dy-compra-modal-actions,
.dy-medico-modal-actions,
.dy-cajero-modal-actions {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(67,126,166,.12);
}


.dy-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dy-toast {
    min-width: 260px;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    animation: fadeInUp 0.25s ease;
}

.dy-toast--success {
    background: linear-gradient(135deg, #19A974, #27c98a);
}

.dy-toast--error {
    background: linear-gradient(135deg, #e5484d, #ff6b6b);
}

.dy-toast--info {
    background: linear-gradient(135deg, #437EA6, #5b9bc6);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}