/* DEV-3.03 | 04-B02-B Device Data */
.patient-create-device {
    box-sizing: border-box;
    width: 100%;
    min-height: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 18px 18px 28px;
    background: #f8fbfc;
}

.patient-create-device__header {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 14px;
}

.patient-create-device__header h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    color: #12304b;
}

.patient-create-device__back {
    min-width: 120px;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: #16677d;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.patient-create-device__tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid #ccd9e3;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 14px;
}

.patient-create-device__tab {
    height: 54px;
    min-height: 54px;
    padding: 0 16px;
    border: 0;
    border-right: 1px solid #ccd9e3;
    background: #fff;
    color: #17364c;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.patient-create-device__tab:last-child { border-right: 0; }
.patient-create-device__tab.is-active {
    color: #087946;
    background: #eef9f5;
    box-shadow: inset 0 -3px #6fb99c;
}
.patient-create-device__tab:disabled {
    cursor: not-allowed;
    color: #8b98a5;
    background: #f3f6f8;
}
.patient-create-device__tab.is-ready:not(.is-active) {
    color: #0b6f85;
    background: #f3fbfd;
}

.patient-device-card {
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid #dbe7e7;
    border-radius: 12px;
    background: #fff;
}

.patient-device-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.patient-device-card__header h2 {
    margin: 0;
    font-size: 16px;
    color: #067347;
}

.patient-device-card__header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
}

.patient-device-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.patient-device-summary__item,
.patient-device-field {
    min-width: 0;
}

.patient-device-summary__item span,
.patient-device-field > label {
    display: block;
    margin-bottom: 6px;
    color: #34495e;
    font-size: 12px;
    font-weight: 700;
}

.patient-device-summary__item strong {
    display: block;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid #d7e0e6;
    border-radius: 8px;
    background: #f7fafb;
    color: #18364e;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-device-edit-basic {
    border: 1px solid #bdd8df;
    border-radius: 8px;
    background: #fff;
    color: #12677b;
    min-height: 36px;
    padding: 0 14px;
    cursor: pointer;
}

.patient-device-flow-row {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    gap: 16px;
    align-items: end;
    margin-top: 14px;
}

.patient-device-field input,
.patient-device-field select,
.patient-device-field textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #ccd8e0;
    border-radius: 8px;
    background: #fff;
    color: #18364e;
    padding: 9px 11px;
    font: inherit;
    box-sizing: border-box;
}

.patient-device-field input:disabled,
.patient-device-field select:disabled {
    background: #eef2f5;
    color: #8b98a5;
}

.patient-device-field textarea {
    min-height: 82px;
    resize: vertical;
}

.patient-device-required { color: #d92d20; }

.patient-device-indication-field {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 8px 46px 8px 12px;
    border: 1px solid #b9d8d1;
    border-radius: 9px;
    background: #fbfefe;
    cursor: pointer;
    outline: none;
}
.patient-device-indication-field:focus {
    box-shadow: 0 0 0 3px rgba(20, 119, 111, .12);
}
.patient-device-indication-field__arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #5c7180;
}
.patient-device-indication-placeholder { color: #82909c; }
.patient-device-indication-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.patient-device-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e8f7f2;
    color: #056c43;
    font-size: 12px;
    font-weight: 650;
}

.patient-device-generator-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.25fr) minmax(220px, 1fr) minmax(220px, .85fr);
    gap: 16px;
    align-items: end;
}

.patient-device-model-wrap,
.patient-device-lead-model-wrap {
    position: relative;
}
.patient-device-candidates {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
}

.patient-device-mri {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid #d3dce3;
    border-radius: 8px;
    background: #f7fafb;
    font-size: 13px;
    font-weight: 700;
}
.patient-device-mri[data-state="YES"] { color: #087a4b; background: #eef9f3; border-color: #9fd1b7; }
.patient-device-mri[data-state="NO"] { color: #bd2c28; background: #fff4f3; border-color: #f1bbb8; }
.patient-device-mri[data-state="UNKNOWN"] { color: #8b5a12; background: #fff9eb; border-color: #eed69d; }

.patient-device-lead-head,
.patient-device-lead-row {
    display: grid;
    grid-template-columns: 130px 130px minmax(260px, 1fr) minmax(190px, .8fr) 78px;
    gap: 10px;
    align-items: center;
}
.patient-device-lead-head {
    padding: 10px 12px;
    border-radius: 8px 8px 0 0;
    background: #eff8f5;
    color: #315563;
    font-size: 12px;
    font-weight: 700;
}
.patient-device-lead-row {
    padding: 10px 12px;
    border: 1px solid #e0e8ed;
    border-top: 0;
}
.patient-device-lead-row input,
.patient-device-lead-row select {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid #ced9e0;
    border-radius: 7px;
    box-sizing: border-box;
}
.patient-device-lead-date {
    color: #29475e;
    font-size: 13px;
}
.patient-device-lead-remove {
    min-height: 34px;
    border: 1px solid #d7e0e6;
    border-radius: 7px;
    background: #fff;
    color: #b23a36;
    cursor: pointer;
}
.patient-device-lead-remove:disabled {
    color: #a3adb5;
    cursor: not-allowed;
}
.patient-device-lead-empty {
    min-height: 100px;
    display: grid;
    place-items: center;
    border: 1px dashed #cfdcdf;
    border-radius: 0 0 8px 8px;
    color: #6e7f8d;
    background: #fbfdfd;
    text-align: center;
    padding: 16px;
}
.patient-device-add-lead {
    border: 1px solid #b9ccd5;
    border-radius: 8px;
    background: #fff;
    color: #174f68;
    min-height: 36px;
    padding: 0 14px;
    cursor: pointer;
}

.patient-create-device__footer {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 0;
    padding: 4px 2px 0;
    background: transparent;
}
.patient-device-save-status {
    margin-right: auto;
    color: #6e7f8d;
    font-size: 12px;
}
.patient-device-save-status.is-dirty { color: #b7791f; }
.patient-device-action {
    min-width: 120px;
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid #ccd8e0;
    background: #fff;
    color: #29475e;
    cursor: pointer;
}
.patient-device-action--save { color: #087a4b; border-color: #8bc7a8; }
.patient-device-action--next { background: #0c7187; border-color: #0c7187; color: #fff; }

.patient-device-indication-drawer {
    padding: 0;
    overflow: hidden;
}
.patient-device-indication-drawer__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.patient-device-indication-drawer__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid #e3eaee;
}
.patient-device-indication-drawer__header h2 { margin: 0; font-size: 20px; color: #17364f; }
.patient-device-indication-drawer__header p { margin: 5px 0 0; font-size: 12px; color: #73818d; }
.patient-device-indication-drawer__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: #f0f4f6;
    color: #4b6070;
    cursor: pointer;
}
.patient-device-indication-drawer__tools {
    padding: 12px 18px;
    border-bottom: 1px solid #edf1f3;
}
.patient-device-indication-drawer__tools input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #ccd8e0;
    border-radius: 8px;
    box-sizing: border-box;
}
.patient-device-indication-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 10px;
}
.patient-device-indication-filter {
    min-height: 34px;
    border: 1px solid #d5dfe5;
    border-radius: 7px;
    background: #fff;
    color: #516574;
    cursor: pointer;
    font-size: 12px;
}
.patient-device-indication-filter.is-active {
    border-color: #82c4ad;
    background: #edf9f4;
    color: #087348;
    font-weight: 700;
}
.patient-device-indication-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 6px 18px 12px;
}
.patient-device-indication-row {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: start;
    padding: 11px 4px;
    border-bottom: 1px solid #edf1f3;
    cursor: pointer;
}
.patient-device-indication-row input { margin-top: 3px; }
.patient-device-indication-row__body strong,
.patient-device-indication-row__body span { display: block; }
.patient-device-indication-row__body strong { color: #203d53; font-size: 13px; }
.patient-device-indication-row__body span { margin-top: 3px; color: #74828d; font-size: 11px; }
.patient-device-indication-empty { padding: 26px 4px; text-align: center; color: #75838e; }
.patient-device-indication-drawer__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 16px;
    border-top: 1px solid #e3eaee;
    background: #fff;
}
.patient-device-indication-drawer__footer span { margin-right: auto; color: #60717f; font-size: 12px; }
.patient-device-indication-drawer__footer button {
    min-width: 92px;
    min-height: 38px;
    border-radius: 8px;
    border: 1px solid #ccd8e0;
    background: #fff;
    cursor: pointer;
}
#patient-device-indication-done { background: #0c7187; color: #fff; border-color: #0c7187; }

@media (max-width: 1150px) {
    .patient-device-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .patient-device-generator-grid { grid-template-columns: 1fr 1fr; }
    .patient-device-lead-head,
    .patient-device-lead-row { grid-template-columns: 110px 110px minmax(220px, 1fr) 180px 70px; }
}

@media (max-width: 820px) {
    .patient-create-device { padding: 12px; }
    .patient-device-summary,
    .patient-device-flow-row,
    .patient-device-generator-grid { grid-template-columns: 1fr; }
    .patient-device-lead-head { display: none; }
    .patient-device-lead-row { grid-template-columns: 1fr; border-top: 1px solid #e0e8ed; margin-bottom: 10px; border-radius: 8px; }
    .patient-create-device__footer { flex-wrap: wrap; }
    .patient-device-save-status { width: 100%; }
}

/* DEV-3.04R1 | Canonical New Patient A/B/C tab responsive geometry */
@media (max-width: 700px) {
    .patient-create-device__tabs { grid-template-columns: 1fr; }
    .patient-create-device__tab { border-right: 0; border-bottom: 1px solid #ccd9e3; }
    .patient-create-device__tab:last-child { border-bottom: 0; }
}
