/* ====================================
   diagnosis_picker.css - 选择诊断 Modal 样式
   所有自定义选择器以 .dt- 为前缀（命名空间隔离，不与父框架/页面样式污染）
   在父页面（patients/page.blade.php）中加载
   ==================================== */
.dt-tip {
    background: #eef6ff;
    border: 1px solid #cfe4ff;
    color: #2c5f9e;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    margin-bottom: 12px;
}
.dt-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a2a3a;
}
.dt-add-row-btn {
    border: 1px solid #3b7cff;
    background: #fff;
    color: #3b7cff;
    border-radius: 4px;
    font-size: 12px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all .15s;
}
.dt-add-row-btn:hover { background: #3b7cff; color: #fff; }

/* ---- 明细表 ---- */
.dt-table thead th {
    font-size: 12px;
    color: #6b7a8f;
    background: #fafbfc;
    font-weight: 600;
    padding: 8px 6px;
}
.dt-table tbody td { padding: 6px; vertical-align: middle; }
.dt-row-tooth,
.dt-row-diag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    min-height: 34px;
    padding: 4px 10px;
    border: 1px solid #dbe2ea;
    border-radius: 4px;
    background: #fff;
    color: #1a2a3a;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s;
}
.dt-row-tooth:hover, .dt-row-diag:hover { border-color: #3b7cff; }
.dt-row-tooth .text-placeholder { color: #9aa7b8; }
.dt-row-diag .text-placeholder { color: #9aa7b8; }
.dt-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.dt-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef4ff;
    border: 1px solid #c6d8ff;
    color: #2c5f9e;
    border-radius: 10px;
    font-size: 11px;
    padding: 1px 8px;
}
.dt-badge-remove {
    cursor: pointer;
    color: #7d8da1;
    font-weight: 700;
    line-height: 1;
}
.dt-badge-remove:hover { color: #d93025; }
.dt-remove-row-btn {
    border: none;
    background: none;
    color: #b0bac6;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.dt-remove-row-btn:hover { background: #fdeceb; color: #d93025; }

/* ---- 诊断下拉面板（fixed 定位挂载于 body 顶层，避免被表格容器 overflow 裁剪遮挡） ---- */
.dt-diag-panel {
    position: fixed;
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(20, 40, 70, .12);
    display: none;
}
.dt-diag-panel.open { display: block; }
.dt-diag-search input {
    border: none;
    border-bottom: 1px solid #eef0f3;
    border-radius: 6px 6px 0 0;
    font-size: 12px;
    padding: 7px 10px;
    width: 100%;
    outline: none;
}
.dt-diag-list {
    max-height: 200px;
    overflow: auto;
    padding: 4px;
}
.dt-diag-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.dt-diag-item:hover { background: #f1f5fb; }
.dt-diag-item.selected { background: #eef4ff; color: #2c5f9e; }
.dt-diag-item .dt-diag-code {
    color: #3b7cff;
    font-weight: 600;
    flex-shrink: 0;
}
.dt-diag-item .dt-diag-name { color: #1a2a3a; }
.dt-diag-empty {
    color: #9aa7b8;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}
.dt-diag-cell { position: relative; }

/* ---- 底部操作 ---- */
.dt-btn-primary {
    background-color: #3b7cff !important;
    color: #fff !important;
    border: 1px solid #3b7cff !important;
    font-size: 13px;
}
.dt-btn-primary:hover {
    background-color: #2f6ce8 !important;
    color: #fff !important;
}
.dt-btn-clear {
    background-color: #fff !important;
    color: #6c757d !important;
    border: 1px solid #6c757d !important;
    font-size: 13px;
}
.dt-btn-clear:hover { background-color: #f8f9fa !important; }

/* ---- 诊断 Modal 尺寸：与原子窗口一致（近全屏，宽 1400px、高 100vh-32px） ---- */
/* 高特异性 + !important：压过 Bootstrap modal-dialog-centered+scrollable 组合的 height:100% 覆盖；
   min-height 双保险：即使 height 被覆盖，最小高度仍撑满 */
.dt-modal .modal-dialog.modal-dialog-centered.modal-dialog-scrollable {
    max-width: 1200px;
    width: calc(100vw - 40px);
    height: calc(100vh - 32px) !important;
    min-height: calc(100vh - 32px) !important;
    max-height: calc(100vh - 32px) !important;
    margin: 16px auto !important;
}
.dt-modal .modal-dialog.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* ====================================
   牙位选择面板（诊断 Modal 内嵌，fixed 覆盖层，模板参考 fee_add 的牙位图）
   ==================================== */
.dt-tooth-panel {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .45);
    display: none;
    align-items: center;
    justify-content: center;
}
.dt-tooth-panel.show { display: flex; }
.dt-tooth-card {
    width: 560px;
    max-width: 92vw;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
    overflow: hidden;
}
.dt-tooth-card-head {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    align-items: center;
}
.dt-tooth-card-body {
    padding: 11px;
    max-height: 70vh;
    overflow: auto;
    --cross-color: #4ecdc4;
}
.dt-tooth-card-foot {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid #eee;
}
.dt-tooth-card-foot .btn { font-size: 12px; padding: 6px 16px; border-radius: 4px; }

.dt-tooth-card-head .dt-tooth-action {
    font-size: 10px;
    padding: 4px 9px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 4px;
    transition: all .2s;
}
.dt-tooth-card-head .dt-tooth-action:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.dt-tooth-card-head .dt-tooth-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 15px;
    color: #9ca3af;
    cursor: pointer;
    padding: 3px 6px;
    line-height: 1;
}
.dt-tooth-card-head .dt-tooth-close:hover { color: #374151; }

.dt-tooth-chart {
    position: relative;
    padding: 7px 0;
}
.dt-tooth-chart::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--cross-color);
    transform: translateX(-50%);
    z-index: 1;
}
.dt-tooth-chart::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--cross-color);
    transform: translateY(-50%);
    z-index: 1;
}
.dt-tooth-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: #9ca3af;
    z-index: 2;
    background: #fff;
    padding: 1px 6px;
}
.dt-tooth-side.left { right: 10px; }
.dt-tooth-side.right { left: 10px; }

.dt-tooth-row {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 3px;
    margin: 3px 0;
    position: relative;
    z-index: 2;
}
.dt-tooth-row.deciduous {
    grid-template-columns: repeat(3, 1fr) repeat(5, 1fr) repeat(3, 1fr) repeat(5, 1fr);
}
.dt-tooth-chip {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
    min-height: 22px;
}
.dt-tooth-chip:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.dt-tooth-chip.selected {
    background: #3b7cff;
    color: #fff;
    border-color: #3b7cff;
}
.dt-tooth-chip.empty {
    border: none;
    background: transparent;
    cursor: default;
    pointer-events: none;
    visibility: hidden;
}
.dt-tooth-cancel {
    background-color: #fff !important;
    color: #6c757d !important;
    border: 1px solid #6c757d !important;
}
.dt-tooth-cancel:hover {
    background-color: #f8f9fa !important;
    color: #5a6268 !important;
    border-color: #5a6268 !important;
}
