/* ═══════════════════════════════════════════════════════════════════
   OASIS-E1 Recertification — Shared styles (app palette)
   Primary: #1d4ed8 / #3b82f6 (sidebar/nav); surfaces & borders aligned.
   Use class recert-page on the root wrapper for all recert pages.
   ═══════════════════════════════════════════════════════════════════ */

.recert-page {
    --recert-primary: #1d4ed8;
    --recert-primary-light: #3b82f6;
    --recert-surface: #f8fafc;
    --recert-header-bg: #eff6ff;
    --recert-border: #e2e8f0;
    --recert-text: #0f172a;
    --recert-text-muted: #64748b;
    --recert-success: #16a34a;
    --recert-success-bg: #dcfce7;
    --recert-error: #dc2626;
    --recert-error-bg: #fee2e2;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 16px;
    color: var(--recert-text);
    position: relative;
    isolation: isolate;
}

/* ── Breadcrumb ── */
.recert-breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 12px;
    color: var(--recert-text-muted);
}
.recert-breadcrumb a {
    color: var(--recert-primary-light);
    font-weight: 600;
    text-decoration: none;
}
.recert-breadcrumb a:hover {
    text-decoration: underline;
}

/* ── Title & subtitle ── */
.recert-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--recert-text);
    margin-bottom: 4px;
}
.recert-subtitle {
    font-size: 0.875rem;
    color: var(--recert-text-muted);
    margin-bottom: 16px;
}
.recert-patient {
    color: var(--recert-primary);
    font-weight: 600;
}

/* ── Cards ── */
.recert-card {
    border: 1px solid var(--recert-border);
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 28, 46, 0.06);
}
.recert-card-hdr {
    background: var(--recert-header-bg);
    color: var(--recert-primary);
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--recert-border);
    text-align: center;
    letter-spacing: 0.04em;
}
.recert-card-body {
    padding: 14px 16px;
}

/* ── Inputs ── */
.recert-inp,
.recert-ta,
.recert-sel {
    border: 1px solid var(--recert-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.875rem;
    background: #fff;
    box-sizing: border-box;
}
.recert-inp:focus,
.recert-ta:focus,
.recert-sel:focus {
    outline: none;
    border-color: var(--recert-primary);
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}
.recert-inp:disabled,
.recert-ta:disabled,
.recert-sel:disabled {
    background: var(--recert-surface);
    color: var(--recert-text-muted);
}
.recert-ta {
    width: 100%;
    resize: vertical;
    min-height: 60px;
}
.recert-sel { width: 100%; }

/* ── Labels ── */
.recert-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--recert-text);
    display: block;
    margin-bottom: 4px;
}
.recert-lbl-bold {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--recert-text);
    margin-bottom: 5px;
}

/* ── Checkbox / Radio ── */
.recert-cb,
.recert-rb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
    margin-bottom: 4px;
}
.recert-cb input[type=checkbox],
.recert-cb input[type=radio],
.recert-rb input[type=radio] {
    width: 16px;
    height: 16px;
    accent-color: var(--recert-primary);
    flex-shrink: 0;
}

/* ── Nav (Back / Save / Next) ── */
.recert-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.recert-btn {
    border: 1px solid var(--recert-primary);
    background: var(--recert-header-bg);
    color: var(--recert-primary);
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.recert-btn:hover {
    background: #dbeafe;
}
.recert-btn-save {
    background: var(--recert-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.recert-btn-save:hover:not(:disabled) {
    background: var(--recert-primary-light);
}
.recert-btn-save:disabled {
    background: #94a3b8;
    cursor: default;
}
.recert-btn-next {
    background: var(--recert-success);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.recert-btn-next:hover:not(:disabled) {
    background: #22c55e;
}
.recert-btn-next:disabled {
    background: #86efac;
    cursor: default;
}
.recert-btn-teal {
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}
.recert-btn-teal:hover { background: #0f766e; }

/* ── Table of Contents (RecertMenu) ── */
.recert-toc {
    border: 1px solid var(--recert-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 28, 46, 0.06);
}
.recert-toc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--recert-border);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s;
    background: #fff;
}
.recert-toc-row:last-child { border-bottom: none; }
.recert-toc-row:hover {
    background: var(--recert-header-bg);
}
.recert-toc-row.recert-done {
    background: var(--recert-success-bg);
}
.recert-toc-name { font-weight: 500; color: var(--recert-text); }
.recert-badge-done { color: var(--recert-success); font-size: 0.8125rem; font-weight: 700; }
.recert-badge-not { color: var(--recert-error); font-size: 0.8125rem; font-weight: 700; }

.recert-progress {
    font-size: 0.875rem;
    color: var(--recert-primary);
    font-weight: 600;
}
.recert-next-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--recert-header-bg);
    border: 1px solid var(--recert-border);
    border-radius: 8px;
}
.recert-next-label { font-size: 0.875rem; color: var(--recert-text); font-weight: 600; }
.recert-next-btn {
    background: var(--recert-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.recert-next-btn:hover { background: var(--recert-primary-light); }

/* ── Footer (sign & submit) ── */
.recert-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    background: var(--recert-surface);
    border: 1px solid var(--recert-border);
    border-radius: 10px;
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 1000;
    pointer-events: auto;
}
.recert-footer button,
.recert-footer .btn {
    pointer-events: auto;
    cursor: pointer;
}
.recert-footer-msg { font-size: 0.875rem; }
.recert-sig-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.recert-sig-label { font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.recert-sig-input {
    border: 1px solid var(--recert-border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    width: 220px;
    max-width: 100%;
}
.recert-sig-input:focus {
    outline: none;
    border-color: var(--recert-primary);
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}
.recert-submit-btn {
    background: var(--recert-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.recert-submit-btn:hover:not(:disabled) { background: var(--recert-primary-light); }
.recert-submit-btn:disabled { background: #94a3b8; cursor: default; }
.recert-signed-at { font-size: 0.8125rem; color: var(--recert-text-muted); }

/* ── Sign with PIN modal (matches nurse chart PIN modal) ── */
.recert-pin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 28, 46, 0.5);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.recert-pin-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    width: 400px;
    max-width: 95vw;
    box-shadow: 0 20px 40px rgba(15, 28, 46, 0.2);
}
.recert-pin-title { font-size: 1.1rem; font-weight: 700; color: var(--recert-text); margin-bottom: 6px; }
.recert-pin-desc { font-size: 0.875rem; color: var(--recert-text-muted); margin-bottom: 18px; }
.recert-pin-field label { font-size: 0.8125rem; font-weight: 600; color: var(--recert-text); display: block; margin-bottom: 6px; }
.recert-pin-field input {
    width: 100%;
    border: 1px solid var(--recert-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 1rem;
    letter-spacing: 8px;
    text-align: center;
}
.recert-pin-field input:focus {
    outline: none;
    border-color: var(--recert-primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}
.recert-pin-error { color: #dc2626; font-size: 0.8125rem; margin-top: 6px; }
.recert-pin-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Loading & error states ── */
.recert-loading,
.recert-error {
    padding: 40px 20px;
    text-align: center;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.recert-loading { color: var(--recert-text-muted); }
.recert-error { color: var(--recert-error); font-weight: 600; }
.recert-error pre {
    background: var(--recert-error-bg);
    border: 1px solid var(--recert-error);
    border-radius: 8px;
    padding: 14px;
    font-size: 0.8125rem;
    overflow: auto;
    white-space: pre-wrap;
    text-align: left;
    margin-top: 10px;
}

/* ── Tables (generic) ── */
.recert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    border-radius: 8px;
    overflow: hidden;
}
.recert-table th {
    background: var(--recert-surface);
    padding: 8px 12px;
    font-weight: 700;
    color: var(--recert-text);
    border: 1px solid var(--recert-border);
    text-align: left;
}
.recert-table td {
    padding: 8px 12px;
    border: 1px solid var(--recert-border);
    vertical-align: middle;
}

/* ── Panel variant (teal/cardiac-style header) ── */
.recert-panel-hdr {
    background: #ccfbf1;
    color: #0f766e;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.8125rem;
    border-bottom: 1px solid #99f6e4;
    text-align: center;
    letter-spacing: 0.04em;
}

/* ── Row helpers ── */
.recert-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: flex-end;
    margin-bottom: 8px;
}
