/* =============================================================================
 * NLVP — Prescriber Portal stylesheet ("Deep Rail")
 * Drop into: wwwroot/css/nlvp.css
 *
 * Layered on top of Bootstrap 5. All component selectors use the
 *   .nlvp-*   prefix (sidebar, topbar, kpi, etc.).
 *
 * Variables intentionally mirror the patient-portal nlvp.css palette so the two
 * stylesheets can co-exist or be merged. Override here only if you want the
 * prescriber tool to diverge later.
 * ============================================================================= */

:root {
    /* Core brand greens */
    --nlvp-primary:    #6FA86E;
    --nlvp-deep:       #467050;
    --nlvp-deep-dark:  #324F39;   /* re-derived — top of sidebar gradient */
    --nlvp-deep-mid:   #37573E;   /* re-derived — bottom of sidebar gradient */
    --nlvp-sage:       #8EC48A;
    --nlvp-sage-tint:  #E5F2E3;

    /* Supporting blue */
    --nlvp-blue:       #2C7BE5;
    --nlvp-blue-hover: #1F60C2;
    --nlvp-blue-tint:  #E3F2FD;

    /* Neutrals */
    --nlvp-white:      #FFFFFF;
    --nlvp-grey:       #F5F7F9;
    --nlvp-line:       #E5E9EE;
    --nlvp-ink:        #2D3430;
    --nlvp-muted:      rgba(47, 58, 63, 0.62);
    --nlvp-muted-soft: rgba(47, 58, 63, 0.38);

    /* Aliases — resolve var() references elsewhere in this file that predate
       these tokens existing in :root */
    --nlvp-border-color:  var(--nlvp-line);
    --nlvp-surface-color: var(--nlvp-grey);

    /* Accents */
    --nlvp-lime:         #8BC34A;
    --nlvp-danger:       #B3261E;
    --nlvp-danger-tint:  #FBEDEB;
    --nlvp-danger-line:  #F1C6C1;

    --nlvp-success:      #2E7D32;
    --nlvp-success-tint: #EDF7EE;
    --nlvp-success-line: #C8E6C9;

    --nlvp-info:         #1565C0;
    --nlvp-info-tint:    #EDF3FF;
    --nlvp-info-line:    #C2D3F9;

    --nlvp-warning:      #B45309;
    --nlvp-warning-tint: #FFF8EE;
    --nlvp-warning-line: #FCD8A8;

    --nlvp-slate:      #64748B;
    --nlvp-slate-tint: #EEF1F4;

    /* Type */
    --nlvp-serif:      "Lora", Georgia, "Times New Roman", serif;
    --nlvp-sans:       "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --nlvp-mono:       ui-monospace, "SF Mono", Menlo, monospace;

    /* Type weight — bold is the only weight that ever needs naming; regular is
       the browser default, so components rely on inheritance instead of a var */
    --nlvp-fw-bold: 600;

    /* Type scale — even px sizes only, odd/half-pixel sizes round up (16px root = 1rem) */
    --nlvp-fs-10: 0.625rem;  /* 10px */
    --nlvp-fs-12: 0.75rem;   /* 12px */
    --nlvp-fs-14: 0.875rem;  /* 14px */
    /* no --nlvp-fs-16 — 1rem is the inherited default, don't redeclare it */
    --nlvp-fs-18: 1.125rem;  /* 18px */
    --nlvp-fs-20: 1.25rem;   /* 20px */
    --nlvp-fs-30: 1.875rem;  /* 30px */

    /* Heading-scale aliases — only h1/h2 are real heading levels anywhere in
       this portal (h1 is the only real <hN class="nlvp-hN"> tag; h2 is real
       in the patient portal, kept here for cross-portal value parity). Same
       values as the patient-portal nlvp.css ladder (h1=30/h2=20px). */
    --nlvp-fs-h1: var(--nlvp-fs-30);
    --nlvp-fs-h2: var(--nlvp-fs-20);

    /* Size-tier aliases — no real <h3>-<h6> tag anywhere uses these; every
       consumer is unrelated UI chrome (nav items, badges, kickers, chips)
       that happens to borrow one of these steps, so they're named by size
       instead of implying a heading level. Same values on both portals. */
    --nlvp-fs-md:  var(--nlvp-fs-18);
    --nlvp-fs-sm:  var(--nlvp-fs-14);
    --nlvp-fs-xs:  var(--nlvp-fs-12);
    --nlvp-fs-xxs: var(--nlvp-fs-10);

    /* Layout */
    --nlvp-radius:      12px;
    --nlvp-radius-sm:   8px;
    --nlvp-radius-pill: 999px;
    --nlvp-shadow:       0 1px 2px rgba(47,58,63,0.04), 0 8px 24px rgba(47,58,63,0.06);
    --nlvp-focus:        0 0 0 3px rgba(76, 175, 80, 0.25);
    --nlvp-focus-danger: 0 0 0 3px rgba(179, 38, 30, 0.12);

    /* Motion */
    --nlvp-transition-fast:   0.1s ease;
    --nlvp-transition:        0.12s ease;
    --nlvp-transition-slow:   0.15s ease;
    --nlvp-transition-slower: 0.2s ease;

    /* Shell sizes */
    --nlvp-sidebar-w:   248px;
    --nlvp-topbar-h:    60px;
}

/* =============================================================================
 * SIDEBAR  (Concept C — deep rail, full height)
 * ============================================================================= */

.nlvp-sidebar {
    width: var(--nlvp-sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg,
        var(--nlvp-deep-dark) 0%,
        var(--nlvp-deep)      60%,
        var(--nlvp-deep-mid)  100%);
    color: var(--nlvp-white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

/* Flag icon in Flagged Items table; risk crest icon shares the same sizing */
.nlvp-flag-icon,
.nlvp-crest-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-right: 8px;
}
/* Heading type scale — h1/h2 are the only two real heading levels anywhere
   in this portal, so they're the only ones with a class. Everything else
   that used to be here (h3-h6) had zero real <hN> usage and is gone; those
   sizes live on as --nlvp-fs-md/sm/xs/xxs for the UI chrome that actually
   consumes them (see elsewhere in this file). */
.nlvp-h1,
.nlvp-h2 {
    font-family: var(--nlvp-serif);
}
.nlvp-h1 {
    font-weight: 400; /* browser bolds <h1> by default; this deliberately un-bolds it */
    font-size: var(--nlvp-fs-h1);
    line-height: 1.15;
    color: var(--nlvp-primary);
    margin: 14px 0 8px;
    text-wrap: pretty;
}
.nlvp-h2 {
    font-size: var(--nlvp-fs-h2);
    font-weight: var(--nlvp-fw-bold);
    line-height: 1.25;
    color: var(--nlvp-deep);
    margin: 24px 0 8px;
}

.nlvp-bold {
    font-weight: var(--nlvp-fw-bold);
}

.nlvp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
@media (max-width: 1100px) {
    .nlvp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Primary action button */
.nlvp-np-name__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.nlvp-np-name__label {
    font-size: var(--nlvp-fs-sm);
    font-weight: var(--nlvp-fw-bold);
    color: var(--nlvp-ink);
}
.nlvp-np-name__credential {
    font-size: var(--nlvp-fs-xs);
    color: var(--nlvp-muted);
}
.nlvp-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: var(--nlvp-fs-xs);
    font-weight: var(--nlvp-fw-bold);
    letter-spacing: 0.03em;
}
.nlvp-modal__action-btn {
    min-width: 70px;
    place-content: center;
    flex-wrap: wrap;
}
.nlvp-status--inactive .nlvp-status__dot { background: var(--nlvp-muted-soft); }

/* Prescriber button layout: centre wrapped content (the shared .nlvp-btn base is Admin's). */
.nlvp-btn {
    place-content: center;
    flex-wrap: wrap;
}

/* Medical-blue button variants */
.nlvp-btn--medical-blue {
    background: var(--nlvp-blue);
    color: var(--nlvp-white);
    border: 1px solid var(--nlvp-blue);
}
.nlvp-btn--medical-blue:hover {
    background: var(--nlvp-blue-hover);
    border-color: var(--nlvp-blue-hover);
    color: var(--nlvp-white);
}

.nlvp-btn--medical-blue-outline {
    background: var(--nlvp-white);
    color: var(--nlvp-blue);
    border: 1px solid var(--nlvp-blue);
}
.nlvp-btn--medical-blue-outline:hover {
    background: var(--nlvp-blue-tint);
    color: var(--nlvp-blue-hover);
    border-color: var(--nlvp-blue-hover);
}

/* Card section title */
.nlvp-card__section-title {
    font-size: var(--nlvp-fs-h2);
    font-weight: var(--nlvp-fw-bold);
    color: var(--nlvp-ink);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--nlvp-border-color);
}

/* Signature preview */
.nlvp-signature-preview {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 16px;
    background: var(--nlvp-surface-color);
    border: 1px solid var(--nlvp-border-color);
    border-radius: var(--nlvp-radius-sm);
}
.nlvp-signature-preview__thumb {
    width: 120px;
    height: 72px;
    object-fit: contain;
    background: var(--nlvp-white);
    border: 1px solid var(--nlvp-border-color);
    border-radius: 6px;
    padding: 8px;
}

/* Professional membership rows */
.nlvp-membership-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px solid var(--nlvp-border-color);
}
.nlvp-table--interactive tbody tr:hover { background: var(--nlvp-surface-color); }
.nlvp-choice-list--row .nlvp-choice__body { display: block; }
.nlvp-choice__price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.nlvp-choice__price-amount { font-weight: var(--nlvp-fw-bold); color: var(--nlvp-deep); }

/* Account configuration alert (dashboard) */
.nlvp-account-alert {
    background: var(--nlvp-danger-tint);
    border: 1px solid var(--nlvp-danger-line);
    border-radius: var(--nlvp-radius);
    padding: 16px;
    margin-bottom: 20px;
}
.nlvp-account-alert__header { display: flex; gap: 12px; align-items: center; }
.nlvp-account-alert__icon,
.nlvp-account-alert__item i { color: var(--nlvp-danger); font-size: var(--nlvp-fs-md); flex-shrink: 0; }
.nlvp-account-alert__title { font-weight: var(--nlvp-fw-bold); color: var(--nlvp-danger); margin: 0 0 4px; }
.nlvp-account-alert__desc { font-size: var(--nlvp-fs-sm); color: var(--nlvp-muted); margin: 0; }
.nlvp-account-alert__items { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.nlvp-account-alert__item {
    display: flex; gap: 12px; align-items: center;
    background: var(--nlvp-white); border: 1px solid var(--nlvp-line);
    border-radius: var(--nlvp-radius-sm); padding: 12px 14px;
}
.nlvp-account-alert__footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nlvp-account-alert__footer-note { font-size: var(--nlvp-fs-sm); color: var(--nlvp-muted); }
body.nlvp-has-sticky-footer { padding-bottom: 64px; }

/* =============================================================================
 * RESPONSIVE  —  collapse the rail to icons / hide on small screens
 * (kept minimal; the admin tool is desktop-first)
 * ============================================================================= */

@media (max-width: 900px) {
    .nlvp-shell { flex-direction: column; }
    .nlvp-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        align-items: center;
        padding: 0 12px;
    }
    .nlvp-sidebar__brand { border-bottom: 0; padding: 12px 6px; }
    .nlvp-sidebar__nav,
    .nlvp-sidebar__footer,
    .nlvp-env-ribbon-wrap { display: none; }
    .nlvp-shell__content { padding: 18px; }
    .nlvp-topbar { padding: 0 14px; gap: 10px; }
    .nlvp-search { width: 160px; }
}

.nlvp-detail-tabs__tab-dot {
    position: absolute;
    top: 6px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nlvp-primary);
}

/* =============================================================================
 * Patient detail — header card
 * ============================================================================= */

.nlvp-patient-header {
    background: var(--nlvp-white);
    border: 1px solid var(--nlvp-line);
    border-radius: var(--nlvp-radius);
    box-shadow: var(--nlvp-shadow);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.nlvp-patient-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .nlvp-patient-header__top { flex-wrap: wrap; }
    .nlvp-patient-header__inline-stats {
        order: 5;
        flex-basis: 100%;
        padding-left: 72px; /* 56px crest + 16px gap */
    }
}

@media (max-width: 900px) {
    .nlvp-two-col-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .nlvp-three-col-grid { grid-template-columns: 1fr; }
}

.nlvp-pill--xs { font-size: var(--nlvp-fs-xxs); padding: 2px 8px; }

/* ============================================================
   Patient claim status
   ============================================================ */

.nlvp-claim-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 13px 3px 3px;
    border-radius: var(--nlvp-radius-pill);
    font-size: var(--nlvp-fs-sm);
    font-weight: var(--nlvp-fw-bold);
    line-height: 1.2;
}
.nlvp-claim-indicator__icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}
.nlvp-claim-indicator__label {
    font-size: var(--nlvp-fs-xxs);
    font-weight: var(--nlvp-fw-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    opacity: 0.75;
}
.nlvp-claim-indicator--available {
    background: var(--nlvp-blue-tint);
    color: var(--nlvp-blue-hover);
    border: 1px solid rgba(44, 123, 229, 0.20);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    height: 38px;
}
.nlvp-claim-indicator--claimed {
    background: var(--nlvp-blue);
    color: var(--nlvp-white);
    height: 38px;
}
.nlvp-claim-indicator--claimed .nlvp-claim-indicator__icon {
    background: var(--nlvp-white);
    border-radius: 50%;
    padding: 3px;
    width: 32px;
    height: 32px;
}

.nlvp-patient-header__claim {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: space-between;
    height: 82px;
}
.nlvp-patient-header__claim form,
.nlvp-patient-header__claim form button {
    width: 100%;
}
.nlvp-patient-header__claim form button {
    justify-content: center;
}

.nlvp-patient-header__status-separator {
    width: 1px;
    align-self: stretch;
    background-color: var(--nlvp-line);
    margin: 0 0.75rem;
}

.nlvp-patient-header__status {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    height: 82px;
}

.nlvp-patient-header__status--with-button .nlvp-patient-header__status-icon {
    width: 38px;
}

@media (max-width: 900px) {
    .nlvp-detail-prescription-info {
        grid-template-columns: 1fr;
    }
}

.nlvp-create-prescription-info {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .nlvp-create-prescription-info {
        grid-template-columns: 1fr;
    }
}

.nlvp-chosen-medication-col {
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nlvp-chosen-medication__rule {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    margin: 12px 0;
}

.nlvp-chosen-medication__period {
    font-size: var(--nlvp-fs-sm);
    color: rgba(255, 255, 255, 0.85);
    margin-left: 4px;
}