.hnc-wrap {
    font-family: 'Poppins', sans-serif;
    width: 100%;
}

.hnc-card {
    background: #ffffff;
    border: 1px solid #e6eff2;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.05);
    margin-bottom: 22px;
}

.hnc-card h3,
.hnc-card h4 {
    color: #1d4e64;
    margin: 0 0 16px;
    font-weight: 600;
}

.hnc-section-heading {
    text-align: center;
}

.hnc-auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.hnc-form,
.hnc-card form {
    display: grid;
    gap: 14px;
}

.hnc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.hnc-screening-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hnc-card label {
    display: grid;
    gap: 6px;
    color: #5f6e75;
    font-size: 13px;
    font-weight: 600;
}

.hnc-card input[type="text"],
.hnc-card input[type="email"],
.hnc-card input[type="password"],
.hnc-card input[type="date"],
.hnc-card input[type="tel"],
.hnc-card textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d8e4e9;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #333333;
    background: #ffffff;
    box-sizing: border-box;
}

.hnc-card textarea {
    resize: vertical;
}

.hnc-check {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: 10px !important;
    line-height: 1.45;
}

.hnc-check input {
    margin-top: 3px;
}

.hnc-radio-group {
    border: 1px solid #e6eff2;
    border-radius: 10px;
    padding: 12px;
    display: grid;
    gap: 8px;
    margin: 0;
}

.hnc-radio-group legend {
    color: #1d4e64;
    font-size: 13px;
    font-weight: 600;
    padding: 0 6px;
}

.hnc-radio-option {
    display: inline-flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 7px !important;
    font-weight: 500 !important;
}

.hnc-consent-copy {
    border: 1px solid #e6eff2;
    border-radius: 10px;
    padding: 14px;
    background: #f9fcfd;
    color: #333333;
}

.hnc-consent-copy h5 {
    margin: 0 0 10px;
    color: #1d4e64;
    font-size: 15px;
}

.hnc-consent-copy p {
    margin: 0 0 10px;
    line-height: 1.55;
}

.hnc-mt {
    margin-top: 24px;
}

.hnc-dashboard-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 18px;
}

.hnc-add-patient-toggle {
    width: auto;
    min-width: 160px;
}

.hnc-intake-panel {
    margin-top: 24px;
}

.hnc-table {
    min-width: 1000px;
}

.hnc-actions {
    display: grid;
    gap: 10px;
}

.hnc-actions form {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.hnc-actions input[type="file"] {
    max-width: 190px;
    font-size: 12px;
}

.hnc-muted {
    background: #6c7a80 !important;
}

.hnc-pdf-list {
    display: grid;
    gap: 6px;
    justify-items: center;
}

.hnc-pdf-list a {
    display: inline-block;
}

.hnc-missing {
    color: #6c7a80;
    font-size: 13px;
}

.hnc-patient-tab td {
    background: #f7fbfc;
}

.hnc-patient-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    text-align: left;
}

.hnc-patient-panel h4 {
    color: #1d4e64;
    margin: 0 0 10px;
}

.hnc-patient-panel p {
    margin: 0 0 8px;
}

.hnc-signature-box {
    display: grid;
    gap: 8px;
}

.hnc-signature-pad {
    width: 100%;
    max-width: 600px;
    height: 180px;
    border: 1px solid #d8e4e9;
    border-radius: 10px;
    background: #f8fbfc;
    touch-action: none;
}

.hnc-clear-signature {
    justify-self: start;
    border: 0;
    background: transparent;
    color: #479594;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 760px) {
    .hnc-auth-grid,
    .hnc-grid,
    .hnc-patient-panel {
        grid-template-columns: 1fr;
    }

    .hnc-screening-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =================================
   KLINICARE ADMIN DASHBOARD STYLE
================================= */

.hndr-admin-wrap {
    font-family: 'Poppins', sans-serif;
    width: 100%;
}

.hndr-admin-header {
    margin-bottom: 20px;
}

.hndr-admin-header h3 {
    margin: 0;
    color: #1d4e64;
    font-size: 24px;
    font-weight: 600;
}

.hndr-admin-notice {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.hndr-admin-notice.success {
    background: rgba(47,163,107,0.12);
    color: #1f7d52;
    border: 1px solid rgba(47,163,107,0.25);
}

.hndr-admin-notice.error {
    background: rgba(220,53,69,0.08);
    color: #b02a37;
    border: 1px solid rgba(220,53,69,0.18);
}

.hndr-admin-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.hndr-admin-card {
    background: #ffffff;
    border: 1px solid #e6eff2;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.05);
    text-align: center;
}

.hndr-admin-label {
    display: block;
    font-size: 14px;
    color: #6c7a80;
    margin-bottom: 8px;
}

.hndr-admin-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #1d4e64;
    line-height: 1;
}

.hndr-admin-link-btn,
.hndr-admin-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #479594 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all .25s ease;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(71,149,148,0.18);
    white-space: nowrap;
}

.hndr-admin-link-btn:hover,
.hndr-admin-action-btn:hover {
    background: #1d4e64 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(29,78,100,0.22);
}

.hndr-admin-table-wrap {
    background: #ffffff;
    border: 1px solid #e7eef1;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.04);
    overflow-x: auto;
}

.hndr-admin-section-title {
    margin: 0 0 16px 0;
    color: #1d4e64;
    font-size: 20px;
    font-weight: 600;
}

.hndr-admin-filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.hndr-admin-search,
.hndr-admin-select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d8e4e9;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    font-family: 'Poppins', sans-serif;
    color: #1d4e64;
}

.hndr-admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.hndr-admin-table th,
.hndr-admin-table td {
    text-align: center;
    vertical-align: middle;
}

.hndr-admin-table thead th {
    background: #1d4e64;
    color: #ffffff;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
}

.hndr-admin-table tbody td {
    padding: 14px;
    border-bottom: 1px solid #dfe8ec;
    font-size: 14px;
}

.hndr-admin-table tbody tr:hover {
    background: #f7fbfc;
}

.hndr-admin-status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.hndr-admin-status-submitted,
.hndr-admin-status-new {
    background: rgba(29,78,100,0.1);
    color: #1d4e64;
}

.hndr-admin-status-report_uploaded,
.hndr-admin-status-complete,
.hndr-admin-status-app_referral_created {
    background: rgba(47,163,107,0.12);
    color: #2fa36b;
}

.hndr-admin-status-awaiting_doctor_signature,
.hndr-admin-status-doctor_signed {
    background: rgba(71,149,148,0.12);
    color: #479594;
}

.hndr-admin-status-no_referral_needed {
    background: rgba(108,122,128,0.12);
    color: #6c7a80;
}

.hndr-admin-report-link {
    color: #1d4e64;
    font-weight: 600;
    text-decoration: none;
}

.hndr-admin-report-link:hover {
    color: #479594;
}

.hndr-upload-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hndr-upload-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.hndr-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f6f8;
    color: #1d4e64;
    border: 1px solid #d8e4e9;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    white-space: nowrap;
}

.hndr-upload-label:hover {
    background: #479594;
    color: #ffffff;
    border-color: #479594;
}

.hnc-table .hndr-admin-action-btn,
.hnc-table .hndr-admin-link-btn,
.hnc-table .hndr-upload-label {
    padding: 7px 12px !important;
    font-size: 12px !important;
    min-height: 32px;
    border-radius: 7px;
    box-shadow: none;
}

.hnc-table .hndr-upload-form {
    gap: 6px;
}

.hnc-patient-tab td {
    background: #fbfdfe !important;
    padding: 20px !important;
}

.hnc-patient-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.hnc-patient-panel > div {
    background: #ffffff;
    border: 1px solid #e6eff2;
    border-radius: 12px;
    padding: 16px;
}

@media (max-width: 1200px) {
    .hndr-admin-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .hnc-patient-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .hndr-admin-header h3 {
        font-size: 26px;
        line-height: 1.1;
    }

    .hndr-admin-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .hndr-admin-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    .hndr-admin-label {
        font-size: 12px !important;
        margin-bottom: 6px !important;
        text-align: center;
    }

    .hndr-admin-value {
        font-size: 24px !important;
        text-align: center;
    }

    .hndr-admin-filter-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .hndr-admin-search,
    .hndr-admin-select {
        width: 100%;
        min-width: 100% !important;
    }

    .hndr-admin-table-wrap {
        overflow: visible;
        padding: 16px;
    }

    .hndr-admin-table {
        width: 100%;
        min-width: 100% !important;
        border-collapse: separate;
        border-spacing: 0;
    }

    .hndr-admin-table thead {
        display: none;
    }

    .hndr-admin-table tbody,
    .hndr-admin-table tr {
        display: block;
    }

    .hndr-admin-table tr {
        background: #ffffff;
        border: 1px solid #e7eef1;
        border-radius: 14px;
        box-shadow: 0 6px 14px rgba(0,0,0,0.05);
        padding: 14px;
        margin-bottom: 14px;
    }

    .hndr-admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
        padding: 8px 0 !important;
        border: none !important;
        text-align: left !important;
    }

    .hndr-admin-table td::before {
        content: "";
        flex: 0 0 110px;
        font-weight: 600;
        color: #1d4e64;
        text-align: left;
    }

    .hnc-table td:nth-child(1)::before { content: "Patient"; }
    .hnc-table td:nth-child(2)::before { content: "Doctor"; }
    .hnc-table td:nth-child(3)::before { content: "Device"; }
    .hnc-table td:nth-child(4)::before { content: "Status"; }
    .hnc-table td:nth-child(5)::before { content: "PDFs"; }
    .hnc-table td:nth-child(6)::before { content: "Actions"; }

    .hndr-admin-table td > * {
        margin-left: auto;
        text-align: right;
    }

    .hnc-patient-tab {
        padding: 0 !important;
    }

    .hnc-patient-tab td {
        display: block !important;
        padding: 14px !important;
    }

    .hnc-patient-tab td::before {
        display: none !important;
    }

    .hndr-upload-form {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 6px !important;
        justify-content: flex-end;
    }

    .hndr-admin-action-btn,
    .hndr-upload-label {
        width: auto !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 34px !important;
    }
}

@media (max-width: 500px) {
    .hndr-admin-cards {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 420px) {
    .hndr-admin-header h3 {
        font-size: 24px;
    }

    .hndr-admin-table td::before {
        flex: 0 0 92px;
        font-size: 13px;
    }

    .hndr-admin-table td {
        font-size: 13px;
    }
}

/* Klinicare referrals table now mirrors the app referrals admin columns. */
.hnc-table {
    min-width: 1300px;
}

.hndr-status-locked,
.hndr-admin-no-report,
.hndr-report-locked {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.hndr-status-locked,
.hndr-admin-no-report {
    background: #f1f6f8;
    color: #6c7a80;
}

.hndr-report-locked {
    background: rgba(47,163,107,0.12);
    color: #1f7d52;
    border: 1px solid rgba(47,163,107,0.22);
}

.hndr-report-item-box {
    padding: 8px 0;
}

.hndr-report-item-title {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1d4e64;
    line-height: 1.2;
    margin-bottom: 8px;
}

.hndr-report-item-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

button.hndr-preview-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #479594 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-family: Poppins, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 4px 10px rgba(71,149,148,0.18);
}

button.hndr-preview-toggle:hover {
    background: #1d4e64 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(29,78,100,0.22);
}

@media (max-width: 767px) {
    .hnc-table td:nth-child(1)::before { content: "Referral ID"; }
    .hnc-table td:nth-child(2)::before { content: "Patient"; }
    .hnc-table td:nth-child(3)::before { content: "Doctor"; }
    .hnc-table td:nth-child(4)::before { content: "Date"; }
    .hnc-table td:nth-child(5)::before { content: "Status"; }
    .hnc-table td:nth-child(6)::before { content: "Update Status"; }
    .hnc-table td:nth-child(7)::before { content: "Referral PDF"; }
    .hnc-table td:nth-child(8)::before { content: "Required Reports"; }
    .hnc-table td:nth-child(9)::before { content: "Report Actions"; }
    .hnc-table td:nth-child(10)::before { content: "Preview"; }

    .hndr-preview-toggle {
        width: auto !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 34px !important;
    }
}

.hnc-dob-field {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    color: #5f6e75;
    font-size: 13px;
    font-weight: 600;
}

.hnc-dob-field legend {
    padding: 0;
    margin: 0 0 6px;
    color: #5f6e75;
    font-size: 13px;
    font-weight: 600;
}

.hnc-dob-grid {
    display: grid;
    grid-template-columns: .7fr 1.2fr .9fr;
    gap: 8px;
}

.hnc-card select,
.hnc-dob-grid select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d8e4e9;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #333333;
    background: #ffffff;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .hnc-dashboard-table td:nth-child(1)::before { content: "Referral ID"; }
    .hnc-dashboard-table td:nth-child(2)::before { content: "Patient"; }
    .hnc-dashboard-table td:nth-child(3)::before { content: "Doctor"; }
    .hnc-dashboard-table td:nth-child(4)::before { content: "Date"; }
    .hnc-dashboard-table td:nth-child(5)::before { content: "Status"; }
    .hnc-dashboard-table td:nth-child(6)::before { content: "PDF's"; }
}

.hnc-confirm-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hnc-decline-form {
    margin: 0;
}

.hndr-admin-status-doctor_declined {
    background: rgba(220,53,69,0.08);
    color: #b02a37;
}

@media (max-width: 767px) {
    .hnc-dashboard-table td:nth-child(1)::before { content: "Referral ID"; }
    .hnc-dashboard-table td:nth-child(2)::before { content: "Patient"; }
    .hnc-dashboard-table td:nth-child(3)::before { content: "Doctor"; }
    .hnc-dashboard-table td:nth-child(4)::before { content: "Date"; }
    .hnc-dashboard-table td:nth-child(5)::before { content: "Status"; }
    .hnc-dashboard-table td:nth-child(6)::before { content: "PDF's"; }
}

.hnc-dashboard-timeline-row td {
    background: #fbfdfe !important;
    padding: 14px 18px !important;
}

.hnc-status-timeline {
    display: grid;
    gap: 10px;
    text-align: left;
}

.hnc-timeline-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: flex-start;
    color: #6c7a80;
    font-size: 13px;
    line-height: 1.35;
}

.hnc-timeline-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #d8e4e9;
    margin-top: 3px;
    box-shadow: 0 0 0 4px rgba(216,228,233,0.35);
}

.hnc-timeline-item.is-complete .hnc-timeline-dot {
    background: #479594;
    box-shadow: 0 0 0 4px rgba(71,149,148,0.14);
}

.hnc-timeline-item strong {
    display: block;
    color: #1d4e64;
    font-size: 13px;
    font-weight: 700;
}

.hnc-timeline-item span:not(.hnc-timeline-dot) {
    display: block;
    color: #6c7a80;
    margin-top: 2px;
}

.hnc-timeline-panel {
    grid-column: 1 / -1;
}

@media (max-width: 767px) {
    .hnc-dashboard-timeline-row td {
        display: block !important;
    }

    .hnc-dashboard-timeline-row td::before {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .hnc-dashboard-table td:nth-child(1)::before { content: "Referral ID"; }
    .hnc-dashboard-table td:nth-child(2)::before { content: "Patient"; }
    .hnc-dashboard-table td:nth-child(3)::before { content: "Doctor"; }
    .hnc-dashboard-table td:nth-child(4)::before { content: "Date"; }
    .hnc-dashboard-table td:nth-child(5)::before { content: "Status"; }
    .hnc-dashboard-table td:nth-child(6)::before { content: "Timeline"; }
    .hnc-dashboard-table td:nth-child(7)::before { content: "PDF's"; }
}
