/* =========================================================
   IVF Medication Reminder - Unified UI
   Visual layer only. Business behavior stays in Razor/code.
   ========================================================= */

:root {
    --ivf-primary: #175cd3;
    --ivf-primary-hover: #1849a9;
    --ivf-primary-soft: #eff4ff;
    --ivf-primary-border: #b2ccff;
    --ivf-text: #101828;
    --ivf-heading: #172033;
    --ivf-muted: #667085;
    --ivf-subtle: #98a2b3;
    --ivf-border: #e4e7ec;
    --ivf-border-strong: #d0d5dd;
    --ivf-surface: #ffffff;
    --ivf-surface-soft: #f8fafc;
    --ivf-bg: #f4f7fb;
    --ivf-success: #067647;
    --ivf-success-bg: #ecfdf3;
    --ivf-success-border: #abefc6;
    --ivf-warning: #b54708;
    --ivf-warning-bg: #fffaeb;
    --ivf-warning-border: #fedf89;
    --ivf-danger: #b42318;
    --ivf-danger-bg: #fef3f2;
    --ivf-danger-border: #fecdca;
    --ivf-info: #026aa2;
    --ivf-info-bg: #f0f9ff;
    --ivf-radius-sm: 9px;
    --ivf-radius: 12px;
    --ivf-radius-lg: 16px;
    --ivf-radius-xl: 20px;
    --ivf-shadow-sm: 0 1px 3px rgba(16, 24, 40, .05);
    --ivf-shadow: 0 10px 30px rgba(16, 24, 40, .08);
    --ivf-shadow-lg: 0 24px 64px rgba(16, 24, 40, .16);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--ivf-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ivf-text);
    background:
        radial-gradient(circle at 10% -10%, rgba(23, 92, 211, .08), transparent 32rem),
        linear-gradient(180deg, #f8faff 0, var(--ivf-bg) 340px);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--ivf-primary);
}

a:hover {
    color: var(--ivf-primary-hover);
}

::selection {
    background: #dbe8ff;
    color: #102a56;
}

.content {
    padding: 0 !important;
}

h1,
h2,
h3,
h4 {
    color: var(--ivf-heading);
    letter-spacing: -.025em;
}

input,
select,
textarea {
    color: var(--ivf-text);
}

input::placeholder,
textarea::placeholder {
    color: var(--ivf-subtle);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 92, 211, .14);
}

.validation-message,
.text-danger {
    color: var(--ivf-danger) !important;
}

/* =========================================================
   Staff navigation
   ========================================================= */

.staff-nav {
    position: sticky;
    top: 10px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 18px;
    width: calc(100% - 32px);
    max-width: 1180px;
    margin: 14px auto 26px;
    padding: 10px 12px;
    border: 1px solid rgba(208, 213, 221, .85);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 8px 30px rgba(16, 24, 40, .08);
    backdrop-filter: blur(14px);
}

.staff-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 215px;
}

.staff-nav-logo {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #175cd3 0%, #528bff 100%);
    color: #fff;
    font-size: .82rem;
    font-weight: 850;
    letter-spacing: .04em;
    box-shadow: 0 6px 14px rgba(23, 92, 211, .22);
}

.staff-nav-brand-copy {
    min-width: 0;
}

.staff-nav-title {
    color: var(--ivf-heading);
    font-size: .92rem;
    font-weight: 820;
    line-height: 1.2;
    white-space: nowrap;
}

.staff-nav-subtitle {
    margin-top: 3px;
    color: var(--ivf-muted);
    font-size: .72rem;
    line-height: 1.2;
    white-space: nowrap;
}

.staff-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.staff-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #475467;
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

.staff-nav-link:hover {
    background: #f8fafc;
    color: var(--ivf-heading);
    text-decoration: none;
}

.staff-nav-link-active {
    border-color: #d6e4ff;
    background: var(--ivf-primary-soft);
    color: var(--ivf-primary);
}

.staff-nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.staff-nav-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 180px;
    color: var(--ivf-heading);
    font-size: .82rem;
    line-height: 1.25;
}

.staff-nav-user-info strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-nav-user-info span {
    margin-top: 2px;
    color: var(--ivf-muted);
    font-size: .7rem;
}

.staff-nav-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 11px;
    border: 1px solid var(--ivf-border-strong);
    border-radius: 10px;
    background: #fff;
    color: #344054;
    font-size: .82rem;
    font-weight: 750;
    text-decoration: none;
    transition: background-color .14s ease, border-color .14s ease;
}

.staff-nav-logout:hover {
    border-color: #98a2b3;
    background: #f8fafc;
    color: var(--ivf-heading);
    text-decoration: none;
}

/* =========================================================
   Staff page shell and headers
   ========================================================= */

.staff-dashboard,
.staff-medications-page {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px 48px;
}

.staff-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
}

.staff-dashboard-header h1 {
    margin: 0;
    color: var(--ivf-heading);
    font-size: clamp(1.65rem, 2.5vw, 2.05rem);
    font-weight: 820;
    line-height: 1.13;
    letter-spacing: -.035em;
}

.staff-dashboard-header p {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--ivf-muted);
    line-height: 1.55;
}

.staff-message,
.staff-error,
.patient-message-card,
.patient-error-card {
    border-radius: var(--ivf-radius);
    padding: 14px 16px;
    line-height: 1.5;
}

.staff-message,
.patient-message-card {
    border: 1px solid var(--ivf-border);
    background: #fff;
    color: #475467;
    box-shadow: var(--ivf-shadow-sm);
}

.staff-error,
.patient-error-card {
    border: 1px solid var(--ivf-danger-border);
    background: var(--ivf-danger-bg);
    color: var(--ivf-danger);
}

.followup-primary-button,
.staff-refresh-button,
.staff-login-button,
.notification-button,
.dialog-confirm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid var(--ivf-primary);
    border-radius: 10px;
    background: var(--ivf-primary);
    color: #fff;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.followup-primary-button:hover:not(:disabled),
.staff-refresh-button:hover:not(:disabled),
.staff-login-button:hover:not(:disabled),
.notification-button:hover:not(:disabled),
.dialog-confirm-button:hover:not(:disabled) {
    background: var(--ivf-primary-hover);
    border-color: var(--ivf-primary-hover);
    box-shadow: 0 6px 16px rgba(23, 92, 211, .18);
    transform: translateY(-1px);
}

.followup-secondary-button,
.medication-edit-button,
.order-remove-button,
.dialog-cancel-button,
.followup-disabled-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid var(--ivf-border-strong);
    border-radius: 10px;
    background: #fff;
    color: #344054;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
}

.followup-secondary-button:hover:not(:disabled),
.medication-edit-button:hover:not(:disabled),
.order-remove-button:hover:not(:disabled),
.dialog-cancel-button:hover:not(:disabled) {
    border-color: #98a2b3;
    background: #f8fafc;
}

button:disabled,
.followup-disabled-button {
    opacity: .58;
    cursor: default;
    transform: none !important;
}

/* =========================================================
   Forms and filter panels
   ========================================================= */

.followup-filter-panel,
.medication-toolbar,
.order-section,
.staff-confirmation-section {
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-radius-lg);
    background: #fff;
    box-shadow: var(--ivf-shadow-sm);
}

.followup-filter-panel {
    margin-bottom: 22px;
    padding: 18px;
}

.followup-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.followup-filter-field,
.followup-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.followup-filter-field label,
.followup-form-group label,
.order-filter-search label {
    color: #344054;
    font-size: .82rem;
    font-weight: 750;
}

.followup-filter-field input,
.followup-filter-field select,
.followup-form-group input,
.followup-form-group select,
.followup-form-group textarea,
.followup-select,
.followup-textarea,
.order-patient-search input,
.order-form-grid input,
.order-form-grid select,
.order-form-grid textarea,
.reported-time-input {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--ivf-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ivf-text);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
    transition: border-color .14s ease, box-shadow .14s ease;
}

.followup-form-group textarea,
.followup-textarea,
.order-form-grid textarea {
    min-height: 92px;
    resize: vertical;
}

.followup-mine-option,
.medication-toolbar label,
.order-filter-check,
.followup-complete-option {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #475467;
    font-size: .86rem;
    cursor: pointer;
}

.followup-mine-option {
    margin-top: 14px;
}

.followup-mine-option input,
.medication-toolbar input[type="checkbox"],
.order-filter-check input,
.followup-complete-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ivf-primary);
}

.followup-filter-actions,
.followup-actions {
    display: flex;
    gap: 9px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* =========================================================
   Follow-up dashboard
   ========================================================= */

.followup-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.summary-card {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 17px;
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-radius-lg);
    background: #fff;
    box-shadow: var(--ivf-shadow-sm);
}

.summary-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #84adff;
}

.summary-card:nth-child(2)::before {
    background: #fdb022;
}

.summary-card:nth-child(3)::before {
    background: #6172f3;
}

.summary-card:nth-child(4)::before {
    background: #17b26a;
}

.summary-number {
    color: var(--ivf-heading);
    font-size: 2rem;
    font-weight: 850;
    line-height: 1;
}

.summary-label {
    margin-top: 9px;
    color: var(--ivf-muted);
    font-size: .86rem;
    font-weight: 650;
}

.followup-empty-state {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 82px;
    padding: 15px 17px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--ivf-radius-lg);
    background: rgba(255, 255, 255, .72);
    color: var(--ivf-muted);
}

.followup-empty-state strong,
.followup-empty-state span {
    display: block;
}

.followup-empty-state strong {
    color: #344054;
    font-size: .92rem;
    font-weight: 780;
}

.followup-empty-state span {
    margin-top: 3px;
    font-size: .82rem;
}

.followup-empty-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid var(--ivf-success-border);
    border-radius: 50%;
    background: var(--ivf-success-bg);
    color: var(--ivf-success);
    font-size: 1rem;
    font-weight: 900;
}

.followup-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.followup-card {
    padding: 17px;
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-radius-lg);
    background: #fff;
    box-shadow: var(--ivf-shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.followup-card:hover {
    border-color: #c8d2e1;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .07);
}

.followup-card-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.followup-patient-name {
    color: var(--ivf-heading);
    font-size: 1.05rem;
    font-weight: 820;
}

.followup-patient-code {
    margin-top: 3px;
    color: var(--ivf-muted);
    font-size: .82rem;
}

.followup-status,
.status-badge,
.medication-active,
.medication-inactive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid var(--ivf-border-strong);
    border-radius: 999px;
    background: #fff;
    color: #475467;
    font-size: .75rem;
    font-weight: 750;
    white-space: nowrap;
}

.followup-status-open {
    border-color: var(--ivf-warning-border);
    background: var(--ivf-warning-bg);
    color: var(--ivf-warning);
}

.followup-status-progress {
    border-color: #c7d7fe;
    background: #eef4ff;
    color: #3538cd;
}

.followup-status-completed,
.status-completed,
.medication-active {
    border-color: var(--ivf-success-border);
    background: var(--ivf-success-bg);
    color: var(--ivf-success);
}

.status-partial {
    border-color: var(--ivf-warning-border);
    background: var(--ivf-warning-bg);
    color: var(--ivf-warning);
}

.status-followup {
    border-color: var(--ivf-danger-border);
    background: var(--ivf-danger-bg);
    color: var(--ivf-danger);
}

.medication-inactive {
    background: #f2f4f7;
    color: var(--ivf-muted);
}

.followup-session-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 13px;
    color: #475467;
    font-size: .86rem;
}

.followup-exact-warning {
    color: var(--ivf-danger);
    font-weight: 800;
}

.followup-assigned,
.followup-completed-info,
.followup-readonly-note {
    margin-top: 11px;
    padding: 9px 11px;
    border: 1px solid var(--ivf-border);
    border-radius: 9px;
    background: var(--ivf-surface-soft);
    color: #475467;
    font-size: .84rem;
}

.followup-medications {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.followup-medication {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #edf0f4;
    border-radius: 10px;
    background: #fbfcfe;
}

.followup-pending {
    color: var(--ivf-warning);
    font-weight: 750;
}

.followup-confirmed {
    color: var(--ivf-success);
}

.followup-card-footer {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid #edf0f4;
}

.followup-history {
    margin-top: 14px;
    padding: 13px;
    border-radius: 12px;
    background: #f8fafc;
}

.followup-history-title {
    margin-bottom: 9px;
    color: #344054;
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.followup-history-item {
    padding: 10px 0;
    border-top: 1px solid #e9edf3;
}

.followup-history-item:first-of-type {
    border-top: 0;
}

.followup-history-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #344054;
    font-weight: 700;
}

.followup-history-time,
.followup-history-note {
    margin-top: 4px;
    color: var(--ivf-muted);
    font-size: .82rem;
}

/* =========================================================
   Medication catalog
   ========================================================= */

.medication-toolbar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 16px;
}

.medication-toolbar input[type="text"] {
    flex: 1;
    min-width: 180px;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--ivf-border-strong);
    border-radius: 10px;
    background: #fff;
}

.medication-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-radius-lg);
    background: #fff;
    box-shadow: var(--ivf-shadow-sm);
}

.medication-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
}

.medication-table th,
.medication-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
    vertical-align: middle;
}

.medication-table th {
    background: #f8fafc;
    color: #475467;
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.medication-table tbody tr {
    transition: background-color .12s ease;
}

.medication-table tbody tr:hover {
    background: #fbfcfe;
}

.medication-table tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================================================
   New order
   ========================================================= */

.order-section {
    margin-bottom: 16px;
    padding: 18px;
}

.order-section-title {
    margin: 0;
    color: var(--ivf-heading);
    font-size: 1rem;
    font-weight: 820;
}

.order-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

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

.order-patient-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.order-patient-result {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ivf-border);
    border-radius: 11px;
    background: #fff;
    color: var(--ivf-text);
    text-align: left;
    cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease, transform .12s ease;
}

.order-patient-result:hover {
    border-color: var(--ivf-primary-border);
    background: #f8fbff;
    transform: translateY(-1px);
}

.order-selected-patient,
.order-cycle-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #d6e4ff;
    border-radius: 11px;
    background: #f5f9ff;
}

.order-cycle-summary {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.order-medication-card {
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid var(--ivf-border);
    border-radius: 13px;
    background: #fbfcfe;
}

.order-medication-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

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

.order-field-wide {
    grid-column: span 2;
}

.order-field-full {
    grid-column: 1 / -1;
}

.order-submit-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.order-success {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--ivf-success-border);
    border-radius: var(--ivf-radius-lg);
    background: var(--ivf-success-bg);
}

.order-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.order-created-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.order-created-item {
    padding: 10px 12px;
    border: 1px solid rgba(6, 118, 71, .18);
    border-radius: 10px;
    background: rgba(255, 255, 255, .65);
}

.patient-access-box {
    margin-top: 16px;
    padding: 15px;
    border: 1px solid #d6e4ff;
    border-radius: 12px;
    background: #f5f9ff;
}

.patient-qr-container {
    display: flex;
    justify-content: center;
    margin: 14px 0;
}

.patient-qr-image {
    width: min(260px, 72vw);
    height: auto;
    padding: 10px;
    border: 1px solid var(--ivf-border);
    border-radius: 14px;
    background: #fff;
}

.patient-access-link {
    overflow-wrap: anywhere;
    color: var(--ivf-primary);
    font-size: .86rem;
}

.patient-access-note {
    margin-top: 8px;
    color: var(--ivf-muted);
    font-size: .82rem;
}

/* =========================================================
   Patient schedule
   ========================================================= */

.patient-page {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 18px 48px;
}

.patient-header {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid #d6e4ff;
    border-radius: var(--ivf-radius-xl);
    background:
        linear-gradient(135deg, rgba(239, 244, 255, .94), rgba(255, 255, 255, .98) 55%);
    box-shadow: var(--ivf-shadow);
}

.patient-header::after {
    content: "";
    position: absolute;
    top: -56px;
    right: -48px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(23, 92, 211, .08);
    pointer-events: none;
}

.patient-header h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(1.65rem, 6vw, 2.1rem);
    font-weight: 850;
    line-height: 1.12;
}

.patient-header p {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 8px 0 0;
    color: var(--ivf-muted);
}

.notification-section {
    position: relative;
    z-index: 1;
    margin-top: 16px;
}

.notification-button {
    min-height: 44px;
}

.notification-message {
    margin-top: 9px;
    color: #475467;
    font-size: .84rem;
}

.injection-session {
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-radius-lg);
    background: #fff;
    box-shadow: var(--ivf-shadow-sm);
}

.injection-session-exact {
    border-color: #84adff;
    box-shadow: 0 0 0 1px rgba(23, 92, 211, .08), var(--ivf-shadow-sm);
}

.session-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 13px;
}

.session-title {
    color: var(--ivf-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.session-date {
    margin-top: 3px;
    color: var(--ivf-heading);
    font-size: 1.08rem;
    font-weight: 820;
}

.session-time {
    margin-top: 4px;
    color: var(--ivf-muted);
    font-size: .88rem;
}

.session-status-area {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
}

.exact-time-badge {
    display: inline-flex;
    padding: 4px 8px;
    border: 1px solid var(--ivf-primary-border);
    border-radius: 999px;
    background: var(--ivf-primary-soft);
    color: var(--ivf-primary);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
}

.exact-time-display {
    margin-top: 4px;
    color: var(--ivf-primary);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.04em;
}

.exact-time-warning {
    margin-bottom: 13px;
    padding: 10px 12px;
    border: 1px solid var(--ivf-warning-border);
    border-radius: 10px;
    background: var(--ivf-warning-bg);
    color: #7a2e0e;
    font-size: .86rem;
    font-weight: 650;
}

.session-selection-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 9px;
}

.select-all-button {
    border: 0;
    background: transparent;
    color: var(--ivf-primary);
    font-size: .83rem;
    font-weight: 750;
    cursor: pointer;
}

.medication-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.medication-card {
    display: flex;
    gap: 11px;
    padding: 12px;
    border: 1px solid #e8edf3;
    border-radius: 11px;
    background: #fbfcfe;
    transition: border-color .13s ease, background-color .13s ease;
}

.medication-card:has(input:checked) {
    border-color: #84adff;
    background: #f5f9ff;
}

.medication-select {
    padding-top: 2px;
}

.medication-select input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--ivf-primary);
}

.confirmed-icon {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 50%;
    background: var(--ivf-success-bg);
    color: var(--ivf-success);
    font-size: .82rem;
    font-weight: 900;
}

.medication-info {
    min-width: 0;
    flex: 1;
}

.medication-name {
    color: var(--ivf-heading);
    font-weight: 820;
}

.medication-dose {
    margin-top: 3px;
    color: #475467;
    font-size: .9rem;
}

.medication-instruction {
    margin-top: 7px;
    color: var(--ivf-muted);
    font-size: .84rem;
    line-height: 1.45;
}

.medication-confirmed {
    opacity: .72;
}

.confirmed-text {
    margin-top: 7px;
    color: var(--ivf-success);
    font-size: .82rem;
    font-weight: 750;
}

.confirm-button {
    width: 100%;
    min-height: 48px;
    margin-top: 13px;
    border: 1px solid var(--ivf-primary);
    border-radius: 11px;
    background: var(--ivf-primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: background-color .12s ease, transform .12s ease, box-shadow .12s ease;
}

.confirm-button:hover:not(:disabled) {
    background: var(--ivf-primary-hover);
    box-shadow: 0 6px 16px rgba(23, 92, 211, .18);
    transform: translateY(-1px);
}

.confirm-button:disabled {
    border-color: #d0d5dd;
    background: #eaecf0;
    color: #98a2b3;
}

.patient-loading-page {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 56px 18px;
}

.patient-message-card,
.patient-error-card {
    margin: 0;
}

/* =========================================================
   Dialogs
   ========================================================= */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(3px);
}

.confirmation-dialog {
    width: 100%;
    max-width: 520px;
    max-height: min(90vh, 760px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--ivf-shadow-lg);
}

.dialog-header {
    padding: 20px 20px 8px;
}

.dialog-header h2 {
    margin: 0;
    color: var(--ivf-heading);
    font-size: 1.3rem;
    font-weight: 830;
}

.dialog-header p {
    margin: 6px 0 0;
    color: var(--ivf-muted);
    font-size: .86rem;
}

.dialog-body {
    padding: 10px 20px 18px;
}

.dialog-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid #edf0f4;
    background: rgba(255, 255, 255, .96);
}

.confirmation-preview-list,
.followup-dialog-medications {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.confirmation-preview-item,
.followup-dialog-medication {
    padding: 11px 12px;
    border: 1px solid var(--ivf-border);
    border-radius: 10px;
    background: #f8fafc;
}

.preview-medication-name {
    color: var(--ivf-heading);
    font-weight: 800;
}

.preview-medication-dose {
    margin-top: 3px;
    color: var(--ivf-muted);
    font-size: .85rem;
}

.confirmation-warning,
.dialog-exact-time,
.actual-time-preview,
.reported-time-container {
    margin-top: 13px;
    padding: 11px 12px;
    border: 1px solid var(--ivf-border);
    border-radius: 10px;
    background: #f8fafc;
}

.dialog-error {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ivf-danger-border);
    border-radius: 10px;
    background: var(--ivf-danger-bg);
    color: var(--ivf-danger);
}

.injection-time-section {
    margin-top: 17px;
    padding-top: 14px;
    border-top: 1px solid var(--ivf-border);
}

.injection-time-title {
    margin-bottom: 8px;
    color: #344054;
    font-weight: 800;
}

.time-choice {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    cursor: pointer;
}

.time-choice input {
    width: 19px;
    height: 19px;
    accent-color: var(--ivf-primary);
}

.dialog-exact-time {
    border-color: var(--ivf-primary-border);
    background: var(--ivf-primary-soft);
    text-align: center;
}

.dialog-exact-time-label {
    color: var(--ivf-muted);
    font-size: .82rem;
    font-weight: 750;
}

.dialog-exact-time-value {
    margin-top: 3px;
    color: var(--ivf-primary);
    font-size: 1.9rem;
    font-weight: 900;
}

.dialog-exact-time-note,
.time-help {
    margin-top: 6px;
    color: var(--ivf-muted);
    font-size: .8rem;
}

/* =========================================================
   Staff login
   ========================================================= */

.staff-login-page {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
}

.staff-login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(380px, .88fr);
    width: 100%;
    max-width: 980px;
    overflow: hidden;
    border: 1px solid rgba(208, 213, 221, .9);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(16, 24, 40, .14);
}

.staff-login-intro {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 560px;
    padding: 34px;
    background:
        radial-gradient(circle at 80% 18%, rgba(255, 255, 255, .18), transparent 14rem),
        linear-gradient(145deg, #123d8f 0%, #175cd3 54%, #3b82f6 100%);
    color: #fff;
}

.staff-login-intro::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -110px;
    width: 310px;
    height: 310px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
}

.staff-login-brand-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.staff-login-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 14px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: .9rem;
    font-weight: 850;
    letter-spacing: .04em;
    backdrop-filter: blur(8px);
}

.staff-login-brand-name {
    font-weight: 820;
}

.staff-login-brand-subtitle {
    margin-top: 2px;
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
}

.staff-login-intro-copy {
    position: relative;
    z-index: 1;
    max-width: 490px;
}

.staff-login-kicker {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .88);
    font-size: .72rem;
    font-weight: 780;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.staff-login-intro h1 {
    margin: 16px 0 0;
    color: #fff;
    font-size: clamp(1.95rem, 3.6vw, 2.65rem);
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: -.045em;
}

.staff-login-intro p {
    margin: 16px 0 0;
    color: rgba(255, 255, 255, .78);
    line-height: 1.6;
}

.staff-login-security {
    position: relative;
    z-index: 1;
    max-width: 440px;
    color: rgba(255, 255, 255, .68);
    font-size: .78rem;
}

.staff-login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: none;
    padding: 42px;
    border: 0;
    border-radius: 0;
    background: #fff;
}

.staff-login-card-heading > span {
    color: var(--ivf-primary);
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.staff-login-card-heading h2 {
    margin: 6px 0 0;
    color: var(--ivf-heading);
    font-size: 1.65rem;
    font-weight: 840;
}

.staff-login-card-heading p {
    margin: 7px 0 0;
    color: var(--ivf-muted);
}

.staff-login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 24px;
}

.staff-login-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.staff-login-group label {
    color: #344054;
    font-size: .84rem;
    font-weight: 750;
}

.staff-login-group input {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--ivf-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ivf-text);
}

.staff-login-button {
    min-height: 48px;
    margin-top: 2px;
}

.staff-login-error {
    margin-top: 17px;
    padding: 10px 12px;
    border: 1px solid var(--ivf-danger-border);
    border-radius: 10px;
    background: var(--ivf-danger-bg);
    color: var(--ivf-danger);
    font-size: .86rem;
}

.staff-login-help {
    margin-top: 18px;
    color: var(--ivf-muted);
    font-size: .78rem;
    line-height: 1.45;
}

/* =========================================================
   Public landing page
   ========================================================= */

.home-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 20px 48px;
}

.home-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 56px);
    border: 1px solid #d6e4ff;
    border-radius: 28px;
    background:
        radial-gradient(circle at 88% 16%, rgba(23, 92, 211, .12), transparent 19rem),
        linear-gradient(145deg, #ffffff 0%, #f4f8ff 100%);
    box-shadow: var(--ivf-shadow);
}

.home-brand {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.home-brand-mark {
    display: grid;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #175cd3 0%, #528bff 100%);
    color: #fff;
    font-weight: 850;
    box-shadow: 0 10px 24px rgba(23, 92, 211, .2);
}

.home-eyebrow {
    color: var(--ivf-primary);
    font-size: .76rem;
    font-weight: 820;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.home-hero h1 {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--ivf-heading);
    font-size: clamp(2.1rem, 5.5vw, 4rem);
    font-weight: 880;
    line-height: 1.02;
    letter-spacing: -.05em;
}

.home-lead {
    max-width: 700px;
    margin: 22px 0 0 70px;
    color: var(--ivf-muted);
    font-size: 1.02rem;
    line-height: 1.65;
}

.home-actions {
    margin: 24px 0 0 70px;
}

.home-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 11px;
    background: var(--ivf-primary);
    color: #fff;
    font-weight: 780;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(23, 92, 211, .18);
}

.home-primary-action:hover {
    background: var(--ivf-primary-hover);
    color: #fff;
    text-decoration: none;
}

.home-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.home-feature-card {
    min-height: 190px;
    padding: 20px;
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-radius-lg);
    background: #fff;
    box-shadow: var(--ivf-shadow-sm);
}

.home-feature-number {
    color: var(--ivf-primary);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .06em;
}

.home-feature-card h2 {
    margin: 14px 0 0;
    font-size: 1.05rem;
    font-weight: 820;
}

.home-feature-card p {
    margin: 8px 0 0;
    color: var(--ivf-muted);
    font-size: .88rem;
    line-height: 1.55;
}

.home-security-note {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--ivf-border);
    border-radius: 11px;
    background: rgba(255, 255, 255, .7);
    color: var(--ivf-muted);
    font-size: .82rem;
}

/* =========================================================
   QR / order dialogs shared polish
   ========================================================= */

.qr-patient-summary,
.order-cancel-summary {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 12px;
    border-radius: 10px;
    background: #f8fafc;
}

.qr-warning-card,
.order-version-warning,
.order-edit-confirmed-warning {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ivf-warning-border);
    border-radius: 10px;
    background: var(--ivf-warning-bg);
    color: #7a2e0e;
}

.qr-success-card {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ivf-success-border);
    border-radius: 10px;
    background: var(--ivf-success-bg);
    color: var(--ivf-success);
}

.qr-image-wrap {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.qr-image-wrap img {
    width: min(260px, 70vw);
    padding: 9px;
    border: 1px solid var(--ivf-border);
    border-radius: 13px;
    background: #fff;
}

.qr-link-block {
    padding: 10px 12px;
    border: 1px solid var(--ivf-border);
    border-radius: 10px;
    background: #f8fafc;
    overflow-wrap: anywhere;
    font-size: .82rem;
}

.qr-link-block label {
    display: block;
    margin-bottom: 4px;
    color: #344054;
    font-weight: 750;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1040px) {
    .staff-nav {
        flex-wrap: wrap;
    }

    .staff-nav-links {
        order: 3;
        width: 100%;
        flex-basis: 100%;
        overflow-x: auto;
        padding-top: 4px;
        scrollbar-width: thin;
    }

    .followup-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

@media (max-width: 760px) {
    .staff-nav {
        top: 6px;
        width: calc(100% - 20px);
        margin: 8px auto 20px;
        border-radius: 15px;
    }

    .staff-nav-brand {
        min-width: 0;
        flex: 1;
    }

    .staff-nav-subtitle {
        display: none;
    }

    .staff-nav-user-info {
        display: none;
    }

    .staff-nav-link {
        min-height: 38px;
        padding: 6px 10px;
        font-size: .82rem;
    }

    .staff-dashboard,
    .staff-medications-page {
        padding: 0 12px 36px;
    }

    .staff-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .staff-dashboard-header > button {
        width: 100%;
    }

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

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

    .followup-medications {
        grid-template-columns: 1fr;
    }

    .medication-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .order-patient-search {
        flex-wrap: wrap;
    }

    .order-patient-search input {
        flex: 1 0 100%;
    }

    .order-patient-search button {
        flex: 1;
    }

    .order-patient-result {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .order-selected-patient,
    .order-submit-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .staff-login-page {
        padding: 14px;
    }

    .staff-login-shell {
        grid-template-columns: 1fr;
        max-width: 520px;
        border-radius: 20px;
    }

    .staff-login-intro {
        min-height: auto;
        padding: 26px;
    }

    .staff-login-intro-copy {
        margin-top: 42px;
    }

    .staff-login-intro h1 {
        font-size: 2rem;
    }

    .staff-login-security {
        display: none;
    }

    .staff-login-card {
        padding: 28px 26px 30px;
    }

    .home-page {
        padding: 22px 14px 34px;
    }

    .home-hero {
        padding: 26px 22px;
        border-radius: 20px;
    }

    .home-brand-mark {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .home-lead,
    .home-actions {
        margin-left: 0;
    }

    .home-feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }

    .staff-nav-title {
        font-size: .84rem;
    }

    .staff-nav-logout {
        padding: 6px 9px;
        font-size: .76rem;
    }

    .staff-dashboard-header h1 {
        font-size: 1.7rem;
    }

    .followup-summary,
    .followup-filter-grid,
    .order-form-grid,
    .order-result-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        min-height: 92px;
    }

    .followup-filter-actions > button {
        flex: 1;
    }

    .order-field-wide,
    .order-field-full {
        grid-column: auto;
    }

    .patient-page {
        padding: 12px 10px 30px;
    }

    .patient-header {
        padding: 18px;
        border-radius: 16px;
    }

    .injection-session {
        padding: 13px;
        border-radius: 14px;
    }

    .session-header {
        gap: 10px;
    }

    .exact-time-display {
        font-size: 1.7rem;
    }

    .dialog-backdrop {
        align-items: flex-end;
        padding: 8px;
    }

    .confirmation-dialog {
        max-height: 92svh;
        border-radius: 18px 18px 12px 12px;
    }

    .dialog-actions {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .home-brand {
        gap: 12px;
    }

    .home-hero h1 {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* =========================================================
   Staff management
   ========================================================= */

.staff-management-page {
    padding-bottom: 52px;
}

.staff-management-success {
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid var(--ivf-success-border);
    border-radius: 10px;
    background: var(--ivf-success-bg);
    color: var(--ivf-success);
    font-size: .86rem;
    font-weight: 650;
}

.staff-management-toolbar {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
    padding: 17px 18px;
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-radius-lg);
    background: #fff;
    box-shadow: var(--ivf-shadow-sm);
}

.staff-management-search label {
    display: block;
    margin-bottom: 6px;
    color: #344054;
    font-size: .82rem;
    font-weight: 750;
}

.staff-management-search input {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--ivf-border-strong);
    border-radius: 10px;
    background: #fff;
}

.staff-management-check {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    color: #475467;
    font-size: .84rem;
    cursor: pointer;
}

.staff-management-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ivf-primary);
}

.staff-management-toolbar-actions {
    display: flex;
    gap: 8px;
}

.staff-management-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.staff-management-summary > div {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 11px 14px;
    border: 1px solid var(--ivf-border);
    border-radius: 11px;
    background: rgba(255, 255, 255, .78);
}

.staff-management-summary strong {
    color: var(--ivf-heading);
    font-size: 1.25rem;
    font-weight: 850;
}

.staff-management-summary span {
    color: var(--ivf-muted);
    font-size: .8rem;
}

.staff-management-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ivf-border);
    border-radius: var(--ivf-radius-lg);
    background: #fff;
    box-shadow: var(--ivf-shadow-sm);
}

.staff-management-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.staff-management-table th,
.staff-management-table td {
    padding: 12px 13px;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
    vertical-align: middle;
}

.staff-management-table th {
    background: #f8fafc;
    color: #475467;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.staff-management-table tbody tr:hover {
    background: #fbfcfe;
}

.staff-management-table tbody tr:last-child td {
    border-bottom: 0;
}

.staff-person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.staff-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--ivf-primary-soft);
    color: var(--ivf-primary);
    font-size: .76rem;
    font-weight: 850;
}

.staff-person strong {
    color: var(--ivf-heading);
    font-size: .9rem;
}

.staff-self-badge {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef4ff;
    color: #3538cd;
    font-size: .65rem;
    font-weight: 800;
    vertical-align: middle;
}

.staff-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 145px;
    color: var(--ivf-muted);
    font-size: .8rem;
}

.staff-role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 180px;
}

.staff-role-badge,
.staff-status {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 7px;
    border: 1px solid var(--ivf-border);
    border-radius: 999px;
    background: #f8fafc;
    color: #475467;
    font-size: .68rem;
    font-weight: 750;
    white-space: nowrap;
}

.staff-role-admin {
    border-color: #b2ccff;
    background: #eff4ff;
    color: #1849a9;
}

.staff-role-doctor {
    border-color: #a9efca;
    background: #ecfdf3;
    color: #067647;
}

.staff-role-nurse,
.staff-role-midwife {
    border-color: #c7d7fe;
    background: #eef4ff;
    color: #3538cd;
}

.staff-role-qualitymanager {
    border-color: #fedf89;
    background: #fffaeb;
    color: #b54708;
}

.staff-status-active {
    border-color: var(--ivf-success-border);
    background: var(--ivf-success-bg);
    color: var(--ivf-success);
}

.staff-status-inactive {
    background: #f2f4f7;
    color: #667085;
}

.staff-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    min-width: 185px;
}

.staff-password-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 9px;
    border: 1px solid var(--ivf-border-strong);
    border-radius: 9px;
    background: #fff;
    color: #475467;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
}

.staff-password-button:hover {
    border-color: #98a2b3;
    background: #f8fafc;
}

.staff-management-dialog {
    max-width: 760px;
}

.staff-password-dialog {
    max-width: 480px;
}

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

.staff-role-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--ivf-border);
}

.staff-role-section-title {
    margin-bottom: 9px;
    color: #344054;
    font-size: .86rem;
    font-weight: 800;
}

.staff-role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.staff-role-option,
.staff-account-active {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid var(--ivf-border);
    border-radius: 10px;
    background: #fbfcfe;
    cursor: pointer;
}

.staff-role-option:has(input:checked),
.staff-account-active:has(input:checked) {
    border-color: var(--ivf-primary-border);
    background: #f5f9ff;
}

.staff-role-option input,
.staff-account-active input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 2px 0 0;
    accent-color: var(--ivf-primary);
}

.staff-role-option strong,
.staff-role-option small,
.staff-account-active strong,
.staff-account-active small {
    display: block;
}

.staff-role-option strong,
.staff-account-active strong {
    color: #344054;
    font-size: .84rem;
}

.staff-role-option small,
.staff-account-active small {
    margin-top: 2px;
    color: var(--ivf-muted);
    font-size: .75rem;
    line-height: 1.4;
}

.staff-account-active {
    margin-top: 12px;
}

.staff-self-warning,
.staff-password-note {
    margin-top: 12px;
    padding: 9px 11px;
    border: 1px solid var(--ivf-warning-border);
    border-radius: 9px;
    background: var(--ivf-warning-bg);
    color: #7a2e0e;
    font-size: .8rem;
    line-height: 1.45;
}

.staff-password-note {
    margin-top: 0;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .staff-management-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .staff-management-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .staff-management-toolbar,
    .staff-management-summary,
    .staff-editor-grid,
    .staff-role-options {
        grid-template-columns: 1fr;
    }

    .staff-management-toolbar-actions > button {
        flex: 1;
    }

    .staff-management-check {
        min-height: auto;
    }
}
