/* DEV-3.09R2 | 04-B16-D Direct completed Follow Up entry | hidden-state blocker fix */
.patient-followup[hidden] {
    display: none !important;
}

.patient-followup {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
    padding: 18px 20px 22px;
    box-sizing: border-box;
}

.patient-followup__header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
}

.patient-followup__back,
.patient-followup__action {
    min-height: 40px;
    border: 1px solid #cbd9e2;
    border-radius: 9px;
    background: #fff;
    color: #21465d;
    font-weight: 800;
    padding: 0 14px;
    cursor: pointer;
}

.patient-followup__identity h1 {
    margin: 0;
    font-size: 22px;
    color: #17384d;
}

.patient-followup__identity p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #6a7f8d;
}

.patient-followup__mode-chip {
    border-radius: 999px;
    padding: 7px 11px;
    background: #eaf6f6;
    color: #176b6b;
    font-size: 12px;
    font-weight: 900;
}

.patient-followup__card {
    border: 1px solid #dbe5eb;
    border-radius: 12px;
    background: #fff;
    padding: 15px;
}

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

.patient-followup__card-header h2 {
    margin: 0;
    font-size: 16px;
    color: #1c4259;
}

.patient-followup__card-header p {
    margin: 4px 0 0;
    color: #718591;
    font-size: 12px;
}

.patient-followup__form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.patient-followup__field {
    min-width: 0;
}

.patient-followup__field--wide {
    grid-column: 1 / -1;
}

.patient-followup__field label {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 900;
    color: #284b60;
}

.patient-followup__required {
    color: #b53939;
}

.patient-followup__field input,
.patient-followup__field select,
.patient-followup__field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cddae2;
    border-radius: 8px;
    background: #fff;
    color: #213c4d;
    font: inherit;
    padding: 9px 10px;
    min-height: 40px;
}

.patient-followup__field textarea {
    min-height: 88px;
    resize: vertical;
}

.patient-followup__field.is-error input,
.patient-followup__field.is-error select,
.patient-followup__field.is-error textarea {
    border-color: #c64343;
    box-shadow: 0 0 0 2px rgba(198, 67, 67, .08);
}

.patient-followup__date-wrap,
.patient-followup__candidate-wrap {
    position: relative;
}

.patient-followup__date-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.patient-followup__date-button {
    min-width: 42px;
    border: 1px solid #cddae2;
    border-radius: 8px;
    background: #f7fafb;
    color: #315a70;
    cursor: pointer;
}

.patient-followup__candidate-box {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
}

.patient-followup__nextfu-relation {
    display: inline-flex;
    margin-top: 8px;
    border-radius: 999px;
    padding: 6px 10px;
    background: #f2f6f8;
    color: #516a79;
    font-size: 12px;
    font-weight: 800;
}

.patient-followup__nextfu-relation[data-state="MATCH"] {
    background: #e8f5ef;
    color: #27674d;
}

.patient-followup__nextfu-relation[data-state="OVERRIDE"] {
    background: #fff3df;
    color: #855b18;
}

.patient-followup__remark-wrap {
    position: relative;
}

.patient-followup__remark-count {
    display: block;
    margin-top: 4px;
    text-align: right;
    font-size: 11px;
    color: #84939c;
}

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

.patient-followup__summary-item {
    min-width: 0;
    border-radius: 9px;
    background: #f7fafb;
    padding: 10px 11px;
}

.patient-followup__summary-item--wide {
    grid-column: span 2;
}

.patient-followup__summary-item small {
    display: block;
    color: #748894;
    font-size: 11px;
    margin-bottom: 4px;
}

.patient-followup__summary-item strong {
    display: block;
    color: #24475b;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.patient-followup__table-shell {
    overflow: auto;
    border: 1px solid #e1e8ec;
    border-radius: 9px;
}

.patient-followup__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.patient-followup__table th,
.patient-followup__table td {
    padding: 8px 10px;
    border-bottom: 1px solid #edf1f3;
    text-align: left;
    vertical-align: top;
}

.patient-followup__table th {
    background: #f5f8fa;
    color: #526b7a;
    font-weight: 900;
}

.patient-followup__table tr:last-child td {
    border-bottom: 0;
}

.patient-followup__empty {
    color: #82919a;
    text-align: center !important;
}

.patient-followup__error {
    border-radius: 8px;
    background: #fff0f0;
    color: #9a3535;
    padding: 9px 11px;
    font-size: 12px;
    font-weight: 800;
}

.patient-followup__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 2px;
}

.patient-followup__status {
    color: #718490;
    font-size: 12px;
    font-weight: 800;
}

.patient-followup__status.is-dirty {
    color: #93651c;
}

.patient-followup__actions {
    display: flex;
    gap: 9px;
}

.patient-followup__action--publish {
    border-color: #176d72;
    background: #176d72;
    color: #fff;
    min-width: 128px;
}

.patient-followup__action:disabled,
.patient-followup__back:disabled {
    opacity: .55;
    cursor: default;
}


.patient-followup__detail-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    margin-top: 8px !important;
    color: #526b7a !important;
    font-weight: 800 !important;
    cursor: pointer;
}

.patient-followup__detail-toggle input {
    width: 16px !important;
    min-height: 16px !important;
    height: 16px;
    margin: 0;
    padding: 0;
}

.patient-followup__detail-time {
    margin-top: 7px;
}

.patient-followup__detail-time input {
    min-height: 38px;
}

.patient-followup__detail-time small {
    display: block;
    margin-top: 4px;
    color: #7c8e99;
    font-size: 11px;
}

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

@media (max-width: 700px) {
    .patient-followup { padding: 12px; }
    .patient-followup__header { grid-template-columns: 1fr; }
    .patient-followup__form-grid,
    .patient-followup__summary-grid { grid-template-columns: 1fr; }
    .patient-followup__summary-item--wide { grid-column: auto; }
    .patient-followup__footer { align-items: stretch; flex-direction: column; }
    .patient-followup__actions { width: 100%; }
    .patient-followup__action { flex: 1; }
}


/* DEV-3.09R Battery / Next FU */
.patient-followup__field--battery,
.patient-followup__field--nextfu {
    grid-column: span 2;
    border: 1px solid #dce7ec;
    border-radius: 10px;
    padding: 11px;
    background: #f9fbfc;
}

.patient-followup__battery-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.patient-followup__gt-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    margin: 0 !important;
    min-height: 40px;
    padding: 0 9px;
    border: 1px solid #cddae2;
    border-radius: 8px;
    background: #fff;
    white-space: nowrap;
    cursor: pointer;
}

.patient-followup__gt-toggle input {
    width: 16px !important;
    min-height: 16px !important;
    height: 16px;
    margin: 0;
    padding: 0;
}

.patient-followup__battery-unit {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    background: #eaf3f6;
    color: #2b5d72;
    font-size: 12px;
    white-space: nowrap;
}

.patient-followup__helper {
    display: block;
    margin-top: 6px;
    color: #758995;
    font-size: 11px;
    line-height: 1.45;
}

.patient-followup__preview,
.patient-followup__days {
    display: inline-flex;
    margin-top: 7px;
    border-radius: 999px;
    padding: 5px 9px;
    background: #eaf6f2;
    color: #28644f;
    font-size: 12px;
    font-weight: 900;
}

.patient-followup__preview.is-error,
.patient-followup__days.is-error {
    background: #fff0f0;
    color: #a13a3a;
}

.patient-followup__quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.patient-followup__quick-row button {
    min-height: 36px;
    border: 1px solid #c9d8e0;
    border-radius: 8px;
    background: #fff;
    color: #2c5268;
    padding: 0 12px;
    font-weight: 900;
    cursor: pointer;
}

.patient-followup__quick-row button.is-selected {
    border-color: #167176;
    background: #e7f4f4;
    color: #12676b;
    box-shadow: 0 0 0 2px rgba(22, 113, 118, .08);
}

.patient-followup__next-date-wrap input[readonly] {
    background: #f2f5f6;
    color: #526873;
}

@media (max-width: 1050px) {
    .patient-followup__field--battery,
    .patient-followup__field--nextfu { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .patient-followup__battery-row { grid-template-columns: 1fr; }
    .patient-followup__battery-unit { justify-content: center; }
    .patient-followup__quick-row button { flex: 1 1 72px; }
}
