/* Medibox v373 — dental scheme / extracted teeth / crown presets */

.odontogram-tooth { position: relative; }

/* User-requested extracted-tooth notation: clear X on the tooth chart. */
.odontogram-tooth.tooth-state-missing .tooth-shape { opacity: .2; }
.odontogram-tooth.tooth-state-missing::after {
    content: "×";
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    z-index: 4;
    color: #c53030;
    font-size: 29px;
    line-height: 1;
    font-weight: 900;
    text-shadow: 0 1px 0 #fff;
    pointer-events: none;
}

.tooth-crown-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 5;
    min-width: 21px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 1px solid #bfc6ff;
    border-radius: 999px;
    background: #eef0ff;
    color: #4338ca;
    box-shadow: 0 2px 5px rgba(55,48,163,.12);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .02em;
    pointer-events: none;
}
.tooth-crown-badge[hidden] { display:none !important; }

.dental-tooth-dialog .modal-card { overflow: hidden; }
.dental-crown-editor {
    display: grid;
    gap: 12px;
    padding: 13px;
    border: 1px solid #dfe2ff;
    border-radius: 14px;
    background: linear-gradient(180deg,#fbfbff,#f5f6ff);
}
.dental-crown-editor[hidden] { display:none !important; }
.dental-crown-editor-head {
    display:flex;
    align-items:center;
    gap:10px;
}
.dental-crown-editor-head > span {
    width:36px;
    height:36px;
    flex:0 0 36px;
    display:grid;
    place-items:center;
    border-radius:11px;
    background:#ebeefe;
    color:#4f46e5;
}
.dental-crown-editor-head .ui-icon { width:19px; height:19px; }
.dental-crown-editor-head strong { display:block; color:#25324a; font-size:13px; }
.dental-crown-editor-head small { display:block; margin-top:2px; color:#7b8798; font-size:10px; line-height:1.35; }
.dental-crown-preview {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
}
.dental-crown-preview > span {
    min-width:0;
    padding:9px 10px;
    border:1px solid #e1e6ee;
    border-radius:10px;
    background:#fff;
}
.dental-crown-preview small { display:block; color:#8994a4; font-size:8px; font-weight:850; text-transform:uppercase; letter-spacing:.05em; }
.dental-crown-preview strong { display:block; margin-top:3px; color:#243047; font-size:12px; overflow-wrap:anywhere; }

/* Crown gets a calmer violet state while the material code identifies it. */
.odontogram-tooth.tooth-state-crown { box-shadow: inset 0 0 0 1px rgba(79,70,229,.18); }

@media (max-width: 700px) {
    .dental-tooth-dialog[open] {
        width:calc(100vw - 10px) !important;
        max-width:calc(100vw - 10px) !important;
        margin:5px auto !important;
    }
    .dental-crown-editor { padding:11px; gap:10px; }
    .dental-crown-editor .form-grid.cols-2 { grid-template-columns:1fr !important; }
    .dental-crown-preview { grid-template-columns:1fr 1fr; }
    .odontogram-tooth.tooth-state-missing::after { font-size:25px; }
    .tooth-crown-badge { top:3px; right:3px; min-width:19px; height:17px; font-size:7px; }
}
@media (max-width: 390px) {
    .dental-crown-preview { grid-template-columns:1fr; }
}

/* ================================================================
   Medibox v374 — Crown as a visit service
   ================================================================ */
body.app-body .clinical-service-choice.is-crown-service {
    border-color: #d8d5ff;
    background: linear-gradient(180deg, #ffffff 0%, #faf9ff 100%);
}

body.app-body .clinical-service-choice.is-crown-service:hover,
body.app-body .clinical-service-choice.is-crown-service.is-selected {
    border-color: #7c6ef6;
    background: #f4f2ff;
    box-shadow: 0 0 0 2px rgba(92, 76, 230, .08);
}

body.app-body .clinical-service-choice.is-crown-service .clinical-service-choice-code {
    color: #5b4bd6;
    font-weight: 850;
}

body.app-body .clinical-crown-service-panel {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #dcd9ff;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(79,70,229,.055), rgba(20,184,166,.035)),
        #fff;
}

body.app-body .clinical-crown-service-panel[hidden] {
    display: none !important;
}

body.app-body .clinical-crown-service-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

body.app-body .clinical-crown-service-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #5145cd;
    background: #eeecff;
}

body.app-body .clinical-crown-service-icon .ui-icon {
    width: 19px;
    height: 19px;
}

body.app-body .clinical-crown-service-panel-head > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

body.app-body .clinical-crown-service-panel-head strong {
    color: #1d2939;
    font-size: 13px;
    font-weight: 850;
}

body.app-body .clinical-crown-service-panel-head small {
    color: #78869a;
    font-size: 10px;
    line-height: 1.35;
}

body.app-body .clinical-crown-service-grid {
    display: grid;
    grid-template-columns: minmax(180px, .75fr) minmax(260px, 1.25fr);
    gap: 10px;
    align-items: end;
}

body.app-body .clinical-crown-service-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
}

body.app-body .clinical-crown-service-summary > span {
    min-height: 54px;
    padding: 9px 11px;
    display: grid;
    align-content: center;
    gap: 3px;
    border: 1px solid #e4e8ef;
    border-radius: 11px;
    background: rgba(255,255,255,.9);
}

body.app-body .clinical-crown-service-summary small {
    color: #8591a3;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

body.app-body .clinical-crown-service-summary strong {
    color: #27364c;
    font-size: 11px;
    font-weight: 850;
}

body.app-body .clinical-crown-service-note {
    margin: 9px 0 0;
    color: #66758a;
    font-size: 9px;
    line-height: 1.45;
}

body.app-body .clinical-crown-service-editor-panel {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    body.app-body .clinical-crown-service-panel {
        padding: 11px;
        border-radius: 12px;
    }

    body.app-body .clinical-crown-service-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.app-body .clinical-crown-service-summary {
        grid-template-columns: 1fr 1fr;
    }

    body.app-body .clinical-crown-service-summary > span {
        min-height: 48px;
        padding: 8px 9px;
    }
}

@media (max-width: 390px) {
    body.app-body .clinical-crown-service-summary {
        grid-template-columns: 1fr;
    }
}

