:root {
    --mc-bg: #f4f7fb;
    --mc-sidebar: #101828;
    --mc-sidebar-muted: #98a2b3;
    --mc-primary: #2563eb;
    --mc-card: #ffffff;
    --mc-border: #e4e7ec;
    --mc-text: #101828;
}
* { box-sizing: border-box; }
body { background: var(--mc-bg); color: var(--mc-text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 280px; min-height: 100vh; position: fixed; inset: 0 auto 0 0; background: linear-gradient(180deg, #101828, #111827); color: white; padding: 20px 16px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; padding: 0 8px; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #ffffff; display: grid; place-items: center; font-size: 17px; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 12px 24px rgba(37,99,235,.24); }
.brand strong { display: block; font-size: 18px; letter-spacing: .2px; }
.brand span { color: var(--mc-sidebar-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.sidebar-nav .nav-link { color: #d0d5dd; border-radius: 12px; padding: 10px 12px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active { color: white; background: rgba(255,255,255,.1); }
.sidebar-heading { color: var(--mc-sidebar-muted); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; margin: 18px 12px 8px; }
.main { margin-left: 280px; width: calc(100% - 280px); min-height: 100vh; }
.topbar { height: 86px; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-bottom: 1px solid var(--mc-border); display: flex; justify-content: space-between; align-items: center; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.page-title { font-size: 21px; margin: 0; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 8px; background: #f9fafb; border: 1px solid var(--mc-border); padding: 8px 10px; border-radius: 14px; }
.content-area { padding: 28px; }
.page-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.enterprise-card { border: 1px solid var(--mc-border); border-radius: 18px; box-shadow: 0 10px 32px rgba(16,24,40,.06); overflow: hidden; }
.metric-card { background: var(--mc-card); border: 1px solid var(--mc-border); border-radius: 18px; padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 10px 32px rgba(16,24,40,.05); }
.metric-icon { width: 48px; height: 48px; border-radius: 16px; background: #eff6ff; color: var(--mc-primary); display: grid; place-items: center; font-size: 23px; }
.metric-value { font-size: 28px; font-weight: 800; line-height: 1; }
.metric-label { color: #667085; font-size: 13px; margin-top: 4px; }
.table thead th { background: #f9fafb; color: #475467; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; border-bottom: 1px solid var(--mc-border); }
.table td { vertical-align: middle; }
.btn { border-radius: 10px; }
.form-control, .form-select { border-radius: 11px; border-color: #d0d5dd; }
.form-control:focus, .form-select:focus { border-color: var(--mc-primary); box-shadow: 0 0 0 .2rem rgba(37,99,235,.12); }
.action-cell { white-space: nowrap; }
.timeline-mini { display: grid; gap: 14px; position: relative; }
.timeline-mini > div {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0 14px;
    align-items: start;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--mc-border);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(16,24,40,.04);
}
.timeline-mini > div:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 34px;
    top: 52px;
    bottom: -15px;
    width: 2px;
    background: #dbeafe;
}
.timeline-mini span {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--mc-primary);
    display: grid;
    place-items: center;
    font-weight: 800;
    border: 1px solid #bfdbfe;
    position: relative;
    z-index: 1;
}
.timeline-mini strong {
    grid-column: 2;
    display: block;
    font-size: 14px;
    line-height: 1.35;
    color: #101828;
}
.timeline-mini p {
    grid-column: 2;
    margin: 5px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: normal;
    word-break: normal;
    max-width: 100%;
}
.guest-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 35%), #eef2ff; padding: 20px; }
.guest-card { width: min(100%, 440px); background: white; border: 1px solid var(--mc-border); border-radius: 24px; padding: 30px; box-shadow: 0 24px 80px rgba(16,24,40,.16); }
.login-logo { width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(135deg, #2563eb, #06b6d4); color: white; display: grid; place-items: center; font-weight: 900; margin: 0 auto 18px; font-size: 24px; letter-spacing: -.04em; box-shadow: 0 16px 36px rgba(37,99,235,.26); }
.client-mini { display: flex; align-items: center; gap: 12px; }
.client-mini img, .client-mini span { width: 42px; height: 42px; border-radius: 14px; object-fit: cover; background: #eff6ff; color: var(--mc-primary); display: grid; place-items: center; font-weight: 800; }
.client-mini small { display: block; color: #667085; }
.sticky-card { top: 110px; }
.calc-preview { background: #f8fafc; border: 1px dashed #bfdbfe; border-radius: 16px; padding: 16px; }
.calc-preview.empty { color: #667085; }
.mini-label { display: block; color: #667085; text-transform: uppercase; letter-spacing: .07em; font-size: 11px; }
.product-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.product-profile-grid > div { background: #f9fafb; border: 1px solid var(--mc-border); border-radius: 14px; padding: 14px; }
.product-profile-grid span { display: block; color: #667085; font-size: 12px; margin-bottom: 3px; }
.product-profile-grid strong { display: block; }
@media (max-width: 991.98px) {
    .sidebar { position: static; width: 100%; min-height: auto; }
    .app-shell { display: block; }
    .main { margin-left: 0; width: 100%; }
    .topbar { position: static; height: auto; padding: 18px; align-items: flex-start; gap: 12px; flex-direction: column; }
    .content-area { padding: 18px; }
    .page-toolbar { flex-direction: column; align-items: stretch; }
    .product-profile-grid { grid-template-columns: 1fr; }
}
.formula-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.formula-strip span { background: rgba(255,255,255,.72); border: 1px solid rgba(191,219,254,.85); border-radius: 999px; padding: 4px 10px; }
.output-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.output-card-grid > div { background: linear-gradient(180deg, #ffffff, #f8fafc); border: 1px solid var(--mc-border); border-radius: 16px; padding: 16px; min-height: 92px; }
.output-card-grid span { display: block; color: #667085; text-transform: uppercase; letter-spacing: .07em; font-size: 11px; margin-bottom: 6px; }
.output-card-grid strong { display: block; font-size: 20px; line-height: 1.15; }
@media (max-width: 991.98px) {
    .output-card-grid { grid-template-columns: 1fr; }
}

/* Purchase Orders */
.purchase-order-form .card-header { border-bottom: 1px solid var(--mc-border); }
.po-items-table thead th { white-space: nowrap; }
.po-items-table td { vertical-align: top; }
.po-total-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--mc-border); }
.po-total-row span { color: #667085; }
.po-total-row strong { font-size: 16px; }
.po-grand-total { margin-top: 14px; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, #eff6ff, #f8fafc); border: 1px solid #bfdbfe; display: flex; align-items: center; justify-content: space-between; }
.po-grand-total span { color: #475467; font-weight: 700; }
.po-grand-total strong { color: var(--mc-primary); font-size: 24px; }
.attachment-list { display: grid; gap: 10px; }
.attachment-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--mc-border); border-radius: 14px; background: #f9fafb; }
.attachment-item i { color: var(--mc-primary); font-size: 18px; }
.attachment-item a { font-weight: 600; text-decoration: none; }
.attachment-item a:hover { text-decoration: underline; }

/* Purchase Order product autocomplete */
.po-product-picker { position: relative; min-width: 300px; }
.po-product-picker .input-group { position: relative; z-index: 2; }
.po-product-search { font-weight: 600; }
.po-product-meta { display: block; margin-top: 6px; line-height: 1.25; }
.po-product-menu {
    display: none;
    position: absolute;
    z-index: 1050;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 320px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d0d5dd;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(16,24,40,.18);
    padding: 6px;
}
.po-product-menu.show { display: block; }
.po-product-option {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 11px;
    padding: 10px 12px;
    text-align: left;
    display: block;
    color: #101828;
}
.po-product-option strong { display: block; font-size: 13px; line-height: 1.25; }
.po-product-option span { display: block; margin-top: 3px; color: #667085; font-size: 12px; line-height: 1.35; }
.po-product-option:hover,
.po-product-option.active { background: #eff6ff; color: #1d4ed8; }
.po-product-option:hover span,
.po-product-option.active span { color: #2563eb; }
.po-product-empty { padding: 10px 12px; color: #667085; font-size: 12px; line-height: 1.35; }
.po-items-table { overflow: visible; }
.po-items-table .table-responsive { overflow: visible; }
@media (max-width: 991.98px) {
    .po-product-picker { min-width: 240px; }
}
.purchase-order-form .table-responsive { overflow: visible; }

/* Purchase Order product dropdown visibility fix */
.purchase-order-form .enterprise-card,
.purchase-order-form .card,
.purchase-order-form .card-body,
.purchase-order-form .table-responsive,
.purchase-order-form table,
.purchase-order-form tbody,
.purchase-order-form tr,
.purchase-order-form td {
    overflow: visible !important;
}
.purchase-order-form .po-line { position: relative; }
.purchase-order-form .po-line:focus-within { z-index: 50; }
.po-product-picker { z-index: 60; }
.po-product-picker:focus-within { z-index: 1060; }
.po-product-menu {
    min-width: 360px;
    max-width: min(560px, 90vw);
}
.po-product-dropdown { border-left: 0; }
.po-product-menu.show {
    display: block !important;
    animation: poDropdownIn .08s ease-out;
}
.po-product-option { cursor: pointer; }
.po-product-option mark {
    padding: 0;
    background: transparent;
    color: inherit;
    font-weight: 800;
}
@keyframes poDropdownIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 767.98px) {
    .po-product-menu {
        min-width: 260px;
        max-width: 86vw;
    }
}

/* Supplier Payments */
.supplier-payment-form .enterprise-card,
.supplier-payment-form .table-responsive { overflow: visible; }
.supplier-payment-table thead th { white-space: nowrap; }
.supplier-payment-table td { vertical-align: top; }
.supplier-payment-line { transition: background .12s ease; }
.supplier-payment-line:has(.supplier-payment-check:checked) { background: #f0fdf4; }
.payment-summary-tile {
    border: 1px solid var(--mc-border);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border-radius: 16px;
    padding: 16px;
}
.payment-summary-tile span {
    display: block;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-size: 11px;
    margin-bottom: 6px;
}
.payment-summary-tile strong {
    display: block;
    color: var(--mc-primary);
    font-size: 30px;
    line-height: 1;
}
.supplier-payment-lines-card .card-header {
    border-bottom: 1px solid var(--mc-border);
}
.supplier-payment-table .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}
.supplier-payment-table .supplier-payment-amount {
    min-width: 130px;
    font-weight: 700;
}
@media (max-width: 991.98px) {
    .supplier-payment-table { min-width: 980px; }
}

/* Supplier reports module */
.supplier-report-toolbar .btn { border-radius: 12px; }
.report-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 28px;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 58%, #38bdf8 100%);
    color: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
}
.report-hero:after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -70px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
}
.report-hero-copy,
.report-hero-stats { position: relative; z-index: 1; }
.report-hero-copy { max-width: 720px; }
.report-hero-copy h3 { font-size: clamp(2rem, 4vw, 3.6rem); font-weight: 800; letter-spacing: -.04em; }
.report-progress {
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.25);
    overflow: hidden;
    max-width: 520px;
}
.report-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: rgba(255,255,255,.92);
}
.report-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 12px;
    min-width: 320px;
}
.report-hero-stats div {
    padding: 18px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(6px);
    text-align: center;
}
.report-hero-stats strong { display: block; font-size: 1.65rem; line-height: 1; }
.report-hero-stats span { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; opacity: .86; }
.report-metric .metric-icon { background: #eef6ff; color: #1d4ed8; }
.report-metric.danger-soft .metric-icon { background: #fff1f2; color: #e11d48; }
.report-metric.warning-soft .metric-icon { background: #fffbeb; color: #d97706; }
.report-filter-card .form-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.report-filter-card .btn-group .btn.active { color: #fff; }
.report-status-grid .status-tile {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px 12px;
    background: #fff;
}
.report-status-grid .status-tile strong { display: block; font-size: 2rem; line-height: 1; }
.report-status-grid .status-tile span { display: block; margin-top: 8px; color: #64748b; font-weight: 700; }
.report-status-grid .status-tile.paid { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.report-status-grid .status-tile.partial { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.report-status-grid .status-tile.unpaid { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.report-status-grid .status-tile.pending { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.report-ledger-table thead th {
    white-space: nowrap;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    background: #f8fafc;
}
.report-ledger-table tbody td { vertical-align: middle; }
.table-warning-soft { background: #fffdf5; }
@media (max-width: 991px) {
    .report-hero { flex-direction: column; align-items: flex-start; }
    .report-hero-stats { min-width: 100%; width: 100%; }
}
@media (max-width: 575px) {
    .report-hero { padding: 22px; }
    .report-hero-stats { grid-template-columns: 1fr; }
}

/* Client Protocol Report */
.protocol-toolbar .btn { border-radius: 12px; }
.empty-state-card {
    border: 1px dashed var(--mc-border);
    background: linear-gradient(180deg, #fff, #f8fafc);
    border-radius: 24px;
    padding: 48px 28px;
    text-align: center;
    box-shadow: var(--mc-shadow);
}
.empty-state-card .empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: #eef6ff;
    color: var(--mc-primary);
    font-size: 32px;
}
.protocol-cover {
    border: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .16), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}
.report-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mc-primary);
    background: #eef6ff;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 7px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.protocol-client-box {
    min-width: 290px;
    border: 1px solid var(--mc-border);
    border-radius: 18px;
    padding: 14px;
    background: rgba(255,255,255,.8);
}
.protocol-client-box div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 0;
    border-bottom: 1px dashed #dbe3ef;
}
.protocol-client-box div:last-child { border-bottom: 0; }
.protocol-client-box span,
.protocol-stat-grid span,
.phase-mini-stats span,
.conversion-note span {
    color: #667085;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 800;
}
.protocol-stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 12px;
}
.protocol-stat-grid div,
.phase-mini-stats div,
.conversion-note {
    border: 1px solid var(--mc-border);
    border-radius: 18px;
    background: #fff;
    padding: 16px;
}
.protocol-stat-grid strong {
    display: block;
    color: #0f172a;
    font-size: 1.55rem;
    line-height: 1.15;
    margin-top: 6px;
}
.phase-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 10px;
}
.phase-mini-stats strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
}
.protocol-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}
.protocol-table tbody td { vertical-align: middle; }
.protocol-phase-card { overflow: hidden; }
.conversion-note strong {
    display: block;
    font-size: 1rem;
    margin: 6px 0;
    color: #0f172a;
}
.conversion-note p { color: #667085; margin: 0; }
.output-card-grid-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1199px) {
    .protocol-stat-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
    .phase-mini-stats { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
}
@media (max-width: 767px) {
    .protocol-stat-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .phase-mini-stats { grid-template-columns: 1fr; }
    .protocol-client-box { min-width: 100%; }
    .output-card-grid-six { grid-template-columns: 1fr; }
}
@media print {
    body { background: #fff !important; }
    .sidebar,
    .topbar,
    .no-print,
    .btn,
    .alert-dismissible .btn-close { display: none !important; }
    .app-shell { display: block !important; }
    .main { margin: 0 !important; width: 100% !important; }
    .content-area { padding: 0 !important; }
    .enterprise-card,
    .card { box-shadow: none !important; border: 1px solid #d8dee8 !important; break-inside: avoid; }
    .protocol-table { font-size: 11px; }
    .protocol-stat-grid { grid-template-columns: repeat(3, 1fr); }
    .protocol-phase-card { page-break-inside: avoid; }
}


/* Purchase Order pro workspace width update */
@media (min-width: 1200px) {
    .purchase-order-form > .row > .col-xl-8,
    .purchase-order-form > .row > .col-xl-4 {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
    .purchase-order-form > .row > .col-xl-4 {
        display: grid;
        grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
        align-items: start;
        gap: 1.5rem;
    }
    .purchase-order-form .sticky-card {
        position: static;
        top: auto;
    }
    .purchase-order-form .po-items-table {
        min-width: 1280px;
    }
    .purchase-order-form .po-product-picker {
        min-width: 420px;
    }
}
.purchase-order-form .enterprise-card {
    border-radius: 22px;
}
.po-product-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    margin-right: 7px;
    border-radius: 999px;
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .02em;
    vertical-align: 1px;
}
.po-product-menu {
    min-width: 440px;
}
.po-product-option strong {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

/* PepCal Protocol Builder */
.eyebrow{font-size:.76rem;text-transform:uppercase;letter-spacing:.12em;color:#5b6ee1;font-weight:800}.protocol-builder .form-label{font-weight:700;color:#334155}.protocol-header-card{border-top:4px solid #5b6ee1}.protocol-help-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem}.protocol-help-strip>div{display:flex;gap:.6rem;align-items:center;background:#fff;border:1px solid #e6eaf3;border-radius:18px;padding:.85rem 1rem;box-shadow:0 10px 25px rgba(15,23,42,.05);font-weight:700;color:#334155}.protocol-help-strip i{font-size:1.15rem;color:#5b6ee1}.protocol-phases{display:flex;flex-direction:column;gap:1.25rem}.protocol-phase-card{background:#fff;border:1px solid #e3e8f4;border-radius:24px;padding:1.1rem;box-shadow:0 18px 45px rgba(15,23,42,.07)}.protocol-phase-head{display:grid;grid-template-columns:minmax(260px,1fr) 170px 160px auto;gap:1rem;align-items:end}.protocol-phase-head>div:first-child{display:flex;align-items:center;gap:.75rem}.phase-pill{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;background:linear-gradient(135deg,#3b82f6,#7c3aed);color:#fff;border-radius:999px;padding:.55rem .8rem;font-weight:800;box-shadow:0 10px 20px rgba(59,130,246,.25)}.phase-name-input{font-size:1.05rem;font-weight:800;border:0;background:#f8fafc}.phase-weeks-box label{display:block;font-size:.76rem;text-transform:uppercase;letter-spacing:.08em;color:#64748b;font-weight:800;margin-bottom:.25rem}.phase-range-badge{background:#eef4ff;border:1px solid #dce7ff;border-radius:16px;padding:.75rem 1rem;color:#1e3a8a;font-weight:700;text-align:center}.phase-week-ribbon{display:flex;gap:.45rem;flex-wrap:wrap;margin:1rem 0}.phase-week-ribbon span{display:inline-flex;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:.35rem .65rem;font-weight:700;color:#475569;font-size:.85rem}.phase-items{display:flex;flex-direction:column;gap:1rem}.phase-actions{display:grid;grid-template-columns:auto minmax(260px,1fr);gap:1rem;align-items:start;margin-top:1rem}.protocol-line-card{border:1px solid #dbe5f5;background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);border-radius:22px;padding:1rem;box-shadow:0 12px 30px rgba(37,99,235,.05)}.protocol-line-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.85rem}.protocol-line-grid .field-wide{grid-column:span 2}.protocol-selector-section{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:1rem}.selector-label{font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:#64748b;font-weight:800;margin-bottom:.45rem}.protocol-week-selector,.protocol-day-selector{display:flex;flex-wrap:wrap;gap:.45rem}.week-chip,.day-chip{position:relative;margin:0}.week-chip input,.day-chip input{position:absolute;opacity:0;pointer-events:none}.week-chip span,.day-chip span{display:inline-flex;align-items:center;justify-content:center;border:1px solid #cbd5e1;background:#fff;color:#334155;border-radius:999px;padding:.45rem .72rem;font-weight:800;min-width:46px;cursor:pointer;transition:all .15s ease}.week-chip input:checked+span,.day-chip input:checked+span{background:#2563eb;border-color:#2563eb;color:#fff;box-shadow:0 10px 20px rgba(37,99,235,.18)}.protocol-line-result{margin-top:1rem;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:18px;padding:.85rem}.line-result-empty{color:#64748b;font-weight:600}.protocol-line-output-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.65rem}.protocol-line-output-grid>div,.protocol-metric-grid>div,.protocol-money-grid>div,.report-stat{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:.75rem;box-shadow:0 8px 18px rgba(15,23,42,.04)}.protocol-line-output-grid span,.protocol-metric-grid span,.protocol-money-grid span,.report-stat span{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:#64748b;font-weight:800}.protocol-line-output-grid strong,.protocol-metric-grid strong,.protocol-money-grid strong,.report-stat strong{display:block;font-size:1.02rem;color:#0f172a}.sticky-protocol-summary{position:sticky;top:1rem}.protocol-metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:.65rem}.protocol-money-grid{display:grid;grid-template-columns:1fr;gap:.65rem}.protocol-money-grid strong{font-size:1.35rem}.protocol-summary-table-wrap{max-height:330px}.protocol-report-header{border-top:5px solid #2563eb}.protocol-report-phase{break-inside:avoid}.report-stat strong{font-size:1.55rem;color:#1d4ed8}@media(max-width:1400px){.protocol-line-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.protocol-line-output-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.protocol-help-strip{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:992px){.protocol-phase-head{grid-template-columns:1fr}.phase-actions,.protocol-selector-section{grid-template-columns:1fr}.protocol-line-grid{grid-template-columns:1fr}.protocol-line-grid .field-wide{grid-column:span 1}.sticky-protocol-summary{position:static}.protocol-help-strip{grid-template-columns:1fr}.protocol-metric-grid{grid-template-columns:repeat(2,1fr)}}@media print{.no-print,.sidebar,.topbar{display:none!important}.app-shell{display:block}.main{margin:0!important}.content-area{padding:0!important}.card{box-shadow:none!important}.protocol-report-print{font-size:12px}}

/* PepCal Protocol Builder v2 - clearer peptide workspace and premium layout */
.protocol-builder-v2 {
    --pep-primary: #2563eb;
    --pep-primary-dark: #1d4ed8;
    --pep-purple: #7c3aed;
    --pep-soft: #f8fbff;
    --pep-line: #dbe7ff;
}
.protocol-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem;
    border: 1px solid var(--pep-line);
    border-radius: 28px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .16), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f6f9ff 100%);
    box-shadow: 0 24px 65px rgba(15, 23, 42, .08);
}
.protocol-hero-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.protocol-logo-mark {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--pep-primary), var(--pep-purple));
    box-shadow: 0 18px 32px rgba(37, 99, 235, .25);
}
.protocol-hero-actions,
.protocol-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: flex-end;
}
.protocol-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid #e5edff;
    border-radius: 20px;
}
.protocol-builder-v2 .protocol-phase-card {
    padding: 1.25rem;
    border: 1px solid #dbe7ff;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: 0 24px 55px rgba(37, 99, 235, .08);
}
.phase-just-added {
    animation: pepPhasePulse 1.1s ease;
}
@keyframes pepPhasePulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .28), 0 24px 55px rgba(37, 99, 235, .08); }
    100% { box-shadow: 0 0 0 18px rgba(37, 99, 235, 0), 0 24px 55px rgba(37, 99, 235, .08); }
}
.protocol-builder-v2 .protocol-phase-head {
    grid-template-columns: minmax(320px, 1fr) 180px 180px auto;
    padding-bottom: 1rem;
    border-bottom: 1px solid #edf2ff;
}
.phase-title-group {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.protocol-builder-v2 .phase-name-input {
    min-height: 48px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 16px;
    padding-left: 1rem;
}
.protocol-builder-v2 .phase-weeks-input {
    min-height: 48px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 800;
}
.protocol-builder-v2 .phase-range-badge {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.phase-peptide-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}
.phase-items-empty {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem;
    border: 2px dashed #bfdbfe;
    border-radius: 22px;
    background: #f8fbff;
}
.empty-peptide-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pep-primary);
    background: #eaf2ff;
    font-size: 1.35rem;
    flex: 0 0 auto;
}
.protocol-builder-v2 .phase-actions {
    grid-template-columns: 1fr;
}
.protocol-builder-v2 .protocol-line-card {
    position: relative;
    border: 1px solid #cfe0ff;
    border-radius: 26px;
    padding: 1.15rem;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .07);
    overflow: visible;
}
.protocol-line-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #edf2ff;
}
.protocol-line-title {
    margin: .2rem 0 0;
    font-size: 1.1rem;
    font-weight: 850;
    color: #0f172a;
}
.peptide-counter {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .32rem .65rem;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eaf2ff;
    border: 1px solid #bfdbfe;
    font-weight: 850;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.line-just-added {
    animation: pepLinePulse 1.3s ease;
}
@keyframes pepLinePulse {
    0% { outline: 4px solid rgba(37, 99, 235, .22); transform: translateY(-2px); }
    100% { outline: 0 solid rgba(37, 99, 235, 0); transform: translateY(0); }
}
.protocol-builder-v2 .protocol-line-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}
.protocol-builder-v2 .protocol-line-grid .field-wide {
    grid-column: span 3;
}
.protocol-builder-v2 .protocol-line-grid select,
.protocol-builder-v2 .protocol-line-grid input {
    min-height: 46px;
    border-radius: 14px;
}
.protocol-picker-box {
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1rem;
    background: #fbfdff;
}
.protocol-builder-v2 .week-chip span,
.protocol-builder-v2 .day-chip span {
    min-width: 54px;
    padding: .55rem .8rem;
    border-radius: 14px;
    background: #fff;
}
.protocol-builder-v2 .week-chip input:checked + span,
.protocol-builder-v2 .day-chip input:checked + span {
    background: linear-gradient(135deg, var(--pep-primary), var(--pep-purple));
    border-color: var(--pep-primary);
}
.protocol-builder-v2 .protocol-selector-section {
    gap: 1rem;
    margin-top: 1.1rem;
}
.protocol-builder-v2 .protocol-line-output-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.protocol-builder-v2 .protocol-line-output-grid > div {
    border: 1px solid #dbeafe;
    background: #fff;
}
.protocol-live-card {
    border-top: 4px solid var(--pep-primary);
}
@media (max-width: 1400px) {
    .protocol-builder-v2 .protocol-phase-head {
        grid-template-columns: 1fr 170px 170px auto;
    }
    .protocol-builder-v2 .protocol-line-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .protocol-builder-v2 .protocol-line-grid .field-wide {
        grid-column: span 3;
    }
}
@media (max-width: 992px) {
    .protocol-hero,
    .protocol-hero-main,
    .phase-peptide-toolbar,
    .phase-items-empty,
    .protocol-line-card-head {
        align-items: stretch;
        flex-direction: column;
    }
    .protocol-hero-actions,
    .protocol-bottom-actions {
        justify-content: stretch;
    }
    .protocol-hero-actions .btn,
    .protocol-bottom-actions .btn,
    .phase-peptide-toolbar .btn,
    .phase-items-empty .btn {
        width: 100%;
    }
    .protocol-builder-v2 .protocol-phase-head,
    .protocol-builder-v2 .protocol-line-grid,
    .protocol-builder-v2 .protocol-selector-section,
    .protocol-builder-v2 .protocol-line-output-grid {
        grid-template-columns: 1fr;
    }
    .protocol-builder-v2 .protocol-line-grid .field-wide {
        grid-column: span 1;
    }
}

/* Protocol Builder old-calculator peptide card fix */
.protocol-oldcalc-card {
    border: 2px solid #bfdbfe !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    display: block !important;
}
.old-calc-section {
    border: 1px solid #dbeafe;
    border-radius: 22px;
    padding: 1rem;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
}
.old-calc-section-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: .85rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #edf2ff;
}
.old-calc-section-head > div {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .7rem;
    row-gap: .1rem;
    align-items: center;
}
.old-calc-section-head strong {
    color: #0f172a;
    font-size: 1rem;
}
.old-calc-section-head small {
    grid-column: 2;
    color: #64748b;
}
.old-calc-step {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .2);
}
.protocol-product-profile {
    border: 1px dashed #bfdbfe;
    border-radius: 20px;
    padding: .85rem;
    background: #f8fbff;
}
.protocol-product-info-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .65rem;
}
.protocol-product-info-grid > div {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 16px;
    padding: .75rem;
}
.protocol-product-info-grid span {
    display: block;
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 850;
    color: #64748b;
}
.protocol-product-info-grid strong {
    display: block;
    color: #0f172a;
    font-size: .98rem;
    margin-top: .18rem;
    word-break: break-word;
}
.protocol-selector-section-pro {
    margin-top: 0 !important;
}
.calculation-output-section .protocol-line-result {
    margin-top: 0;
    border-style: solid;
    border-color: #dbeafe;
    background: #f8fafc;
}
.protocol-builder-v2 .protocol-line-output-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1400px) {
    .protocol-product-info-grid,
    .protocol-builder-v2 .protocol-line-output-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 992px) {
    .protocol-product-info-grid,
    .protocol-builder-v2 .protocol-line-output-grid {
        grid-template-columns: 1fr;
    }
    .old-calc-section-head > div {
        grid-template-columns: 1fr;
    }
    .old-calc-section-head small {
        grid-column: 1;
    }
}

/* PepCal peptide card minimize / expand polish */
.peptide-expand-card {
    transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.protocol-line-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
}
.protocol-card-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 800;
    border-radius: 14px;
    white-space: nowrap;
}
.protocol-line-body {
    display: block;
}
.peptide-mini-summary {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: .55rem;
}
.peptide-mini-summary .mini-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: .2rem .55rem;
    border: 1px solid #dbeafe;
    background: #f8fbff;
    color: #1e3a8a;
    font-size: .78rem;
    font-weight: 800;
}
.peptide-mini-summary .mini-pill.muted {
    color: #475569;
    border-color: #e2e8f0;
    background: #f8fafc;
}
.peptide-mini-summary .mini-pill.success {
    color: #166534;
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.protocol-line-collapsed {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    border-color: #93c5fd !important;
    box-shadow: 0 12px 30px rgba(37, 99, 235, .08) !important;
}
.protocol-line-collapsed .protocol-line-body {
    display: none !important;
}
.protocol-line-collapsed .protocol-line-card-head {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}
.protocol-line-collapsed .protocol-line-title {
    margin-bottom: .15rem;
}
@media (max-width: 992px) {
    .protocol-line-card-actions {
        justify-content: stretch;
    }
    .protocol-line-card-actions .btn {
        flex: 1 1 auto;
    }
}

/* Purchase Order discount amount/% controls */
.po-discount-input-group .po-line-discount-type {
    max-width: 68px;
    flex: 0 0 68px;
    font-weight: 800;
    text-align: center;
}
.purchase-order-form .po-discount-type {
    max-width: 74px;
    flex: 0 0 74px;
    font-weight: 800;
}
.po-line-discount-help {
    display: block;
    margin-top: 4px;
    line-height: 1.2;
}

/* PepCal protocol searchable vendor/product dropdowns */
.pepcal-native-hidden-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
}
.pepcal-searchselect {
    position: relative;
    width: 100%;
    z-index: 20;
}
.pepcal-searchselect.open {
    z-index: 2000;
}
.pepcal-searchselect-button {
    width: 100%;
    min-height: 52px;
    border: 1px solid #d4ddeb;
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    color: #111827;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.pepcal-searchselect-button:hover,
.pepcal-searchselect.open .pepcal-searchselect-button {
    border-color: #0d6efd;
    box-shadow: 0 0 0 .22rem rgba(13, 110, 253, .12);
}
.pepcal-searchselect-button.disabled,
.pepcal-searchselect-button:disabled {
    opacity: .72;
    background: #f8fafc;
    cursor: not-allowed;
    box-shadow: none;
}
.pepcal-searchselect-button > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pepcal-searchselect-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}
.pepcal-searchselect-meta {
    display: block;
    min-height: 14px;
    color: #64748b;
    font-size: .78rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pepcal-searchselect-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dbe7fb;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .18);
    padding: 10px;
    max-height: 390px;
    overflow: hidden;
}
.pepcal-searchselect.open .pepcal-searchselect-menu {
    display: block;
}
.pepcal-searchselect-searchwrap {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d8e2f1;
    background: #f8fbff;
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.pepcal-searchselect-searchwrap i {
    color: #0d6efd;
}
.pepcal-searchselect-search {
    border: 0;
    outline: 0;
    background: transparent;
    width: 100%;
    font-weight: 650;
}
.pepcal-searchselect-options {
    max-height: 310px;
    overflow-y: auto;
    padding-right: 2px;
}
.pepcal-searchselect-option {
    width: 100%;
    display: block;
    border: 0;
    background: transparent;
    border-radius: 14px;
    padding: 11px 12px;
    text-align: left;
    color: #111827;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.pepcal-searchselect-option:hover,
.pepcal-searchselect-option.selected {
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
}
.pepcal-searchselect-option:active {
    transform: scale(.995);
}
.pepcal-searchselect-option.disabled {
    color: #94a3b8;
    cursor: not-allowed;
}
.pepcal-searchselect-option strong {
    display: block;
    font-size: .98rem;
    line-height: 1.2;
}
.pepcal-searchselect-option small {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}
.pepcal-searchselect-option small span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: .72rem;
    font-weight: 700;
}
.pepcal-product-searchselect .pepcal-searchselect-option.selected small span,
.pepcal-product-searchselect .pepcal-searchselect-option:hover small span {
    background: #dbeafe;
    color: #1d4ed8;
}
.pepcal-searchselect-empty {
    padding: 22px;
    text-align: center;
    color: #64748b;
    font-weight: 700;
}
.protocol-product.is-loading + .pepcal-searchselect .pepcal-searchselect-button::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #bfdbfe;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: pepcalSpin .75s linear infinite;
    margin-left: 6px;
}
@keyframes pepcalSpin { to { transform: rotate(360deg); } }
.protocol-oldcalc-card .old-calc-section { overflow: visible; }
.protocol-line-card,
.protocol-phase-card,
.phase-items,
.old-calc-section {
    overflow: visible !important;
}

/* PepCal protocol builder: bottom add-peptide action for long phase cards */
.phase-bottom-peptide-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px dashed #bfdbfe;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8fbff, #eef6ff);
}
.phase-bottom-peptide-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #1e293b;
}
.phase-bottom-peptide-text strong {
    font-weight: 800;
}
.phase-bottom-peptide-text small {
    color: #64748b;
    font-weight: 650;
}
.phase-bottom-add-peptide {
    border-radius: 16px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 12px 26px rgba(13, 110, 253, .18);
}
@media (max-width: 768px) {
    .phase-bottom-peptide-action {
        align-items: stretch;
        flex-direction: column;
    }
    .phase-bottom-add-peptide {
        width: 100%;
    }
}

/* Client Protocol Report: protocol separation + days display */
.protocol-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.protocol-index-tile {
    display: block;
    padding: 16px;
    border: 1px solid #dbe7ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(37,99,235,.06);
}
.protocol-index-tile:hover {
    border-color: #2563eb;
    transform: translateY(-1px);
}
.protocol-index-tile span,
.protocol-index-tile small,
.protocol-index-tile em {
    display: block;
}
.protocol-index-tile span {
    color: #2563eb;
    font-size: .75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.protocol-index-tile strong {
    display: block;
    margin: 4px 0;
    font-size: 1rem;
}
.protocol-index-tile small {
    color: #64748b;
    margin-bottom: 6px;
}
.protocol-index-tile em {
    color: #047857;
    font-style: normal;
    font-weight: 800;
}
.protocol-group-card {
    overflow: hidden;
    border-top: 4px solid #2563eb;
}
.protocol-group-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.protocol-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #64748b;
    font-weight: 700;
    margin-top: 6px;
}
.protocol-meta-line span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.protocol-group-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    gap: 10px;
    min-width: min(520px, 100%);
}
.protocol-group-stats > div {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    padding: 12px 14px;
}
.protocol-group-stats span {
    display: block;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 900;
}
.protocol-group-stats strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 1.2rem;
}
.protocol-days-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-weight: 800;
    white-space: nowrap;
}
@media (max-width: 991px) {
    .protocol-group-header { display: block; }
    .protocol-group-stats { grid-template-columns: repeat(2, minmax(92px, 1fr)); margin-top: 14px; }
}
@media print {
    .protocol-index-card { display: none !important; }
    .protocol-group-card { break-inside: avoid; }
    .protocol-group-stats { grid-template-columns: repeat(4, 1fr); }
    .protocol-days-badge { border: 0; padding: 0; background: transparent; color: #111827; }
}

/* Client Protocol Report: per-protocol product summaries */
.protocol-grand-summary-card {
    border-top: 4px solid #0ea5e9;
}
.protocol-single-summary {
    border-bottom: 1px solid #e5edf8;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.protocol-single-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}
.protocol-summary-mini-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.protocol-summary-mini-table td,
.protocol-summary-mini-table th {
    white-space: nowrap;
}
@media print {
    .protocol-grand-summary-card {
        break-inside: avoid;
    }
    .protocol-single-summary {
        background: #fff !important;
        border-bottom: 1px solid #ddd;
    }
}

/* Client Protocol Report: stronger per-protocol separation and peptide totals */
.protocol-group-stack {
    display: grid;
    gap: 28px;
}
.protocol-group-card {
    border: 1px solid #dbe7ff;
    border-top: 6px solid #2563eb;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
}
.protocol-group-card + .protocol-group-card {
    margin-top: 10px;
}
.protocol-single-summary {
    border-bottom: 1px solid #d8e6f8;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 58%, #eef6ff 100%);
}
.protocol-peptide-total-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 14px;
}
.protocol-peptide-total-card {
    border: 1px solid #dbeafe;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, .07);
    padding: 16px;
}
.protocol-peptide-total-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.protocol-peptide-total-head span,
.protocol-peptide-total-metrics span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.protocol-peptide-total-head strong {
    display: block;
    color: #0f172a;
    font-size: 1.05rem;
    line-height: 1.2;
    margin-top: 3px;
}
.protocol-peptide-total-head small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}
.protocol-peptide-total-head em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}
.protocol-peptide-total-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.protocol-peptide-total-metrics > div {
    border-radius: 14px;
    background: #f8fafc;
    padding: 10px 12px;
}
.protocol-peptide-total-metrics strong {
    display: block;
    color: #0f172a;
    font-size: .98rem;
    margin-top: 4px;
}

.protocol-peptide-total-head em.protocol-qty-pill {
    flex-direction: column;
    gap: 2px;
    min-width: 96px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    box-shadow: 0 10px 22px rgba(22, 163, 74, .18);
}
.protocol-peptide-total-head em.protocol-qty-pill span {
    display: block;
    font-size: 10px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .12em;
    color: rgba(255,255,255,.86);
}
.protocol-peptide-total-metrics > div.protocol-qty-metric {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}
.protocol-peptide-total-metrics > div.protocol-qty-metric strong {
    color: #166534;
    font-size: 1.08rem;
}
.phase-detail-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid #edf2f7;
    background: #fff;
}
.protocol-phase-card {
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}
@media print {
    .protocol-peptide-total-grid {
        display: block;
    }
    .protocol-peptide-total-card {
        break-inside: avoid;
        box-shadow: none !important;
        margin-bottom: 10px;
    }
    .protocol-group-card {
        border-top: 3px solid #111827;
        box-shadow: none !important;
    }
}

/* PepCal Client Protocol Report v3 - clean minimized protocol cards */
.protocol-report-v3 .protocol-fold-stack{display:flex;flex-direction:column;gap:1.25rem}.protocol-fold-card{display:block;border:1px solid #dbeafe;border-radius:28px;background:#fff;box-shadow:0 24px 60px rgba(15,23,42,.08);overflow:hidden}.protocol-fold-card[open]{border-color:#93c5fd;box-shadow:0 28px 70px rgba(37,99,235,.12)}.protocol-fold-summary{list-style:none;cursor:pointer;padding:1.35rem 1.5rem;background:linear-gradient(135deg,#fff 0%,#f8fbff 100%)}.protocol-fold-summary::-webkit-details-marker{display:none}.protocol-fold-topline{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.protocol-title-area h3{font-size:1.35rem;margin:0;color:#0f172a}.protocol-fold-actions{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}.protocol-expand-pill{display:inline-flex;align-items:center;gap:.45rem;border:1px solid #bfdbfe;color:#1d4ed8;background:#eff6ff;border-radius:999px;padding:.45rem .85rem;font-weight:800}.protocol-fold-card[open] .protocol-expand-pill i{transform:rotate(180deg)}.protocol-money-summary{display:grid;grid-template-columns:repeat(7,minmax(110px,1fr));gap:.75rem;margin:1rem 0}.protocol-money-summary>div{border:1px solid #e5e7eb;border-radius:18px;padding:.85rem;background:#fff}.protocol-money-summary span,.protocol-top-peptide-metrics b{display:block;color:#64748b;text-transform:uppercase;letter-spacing:.08em;font-size:.72rem;font-weight:900}.protocol-money-summary strong{display:block;color:#0f172a;font-size:1.05rem;margin-top:.25rem}.protocol-top-peptide-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:.85rem}.protocol-top-peptide-card{border:1px solid #dbeafe;background:#fff;border-radius:22px;padding:1rem}.protocol-top-peptide-head{display:flex;justify-content:space-between;gap:.75rem;align-items:flex-start}.protocol-top-peptide-head strong{display:block;color:#0f172a;font-size:1rem}.protocol-top-peptide-head small{display:block;color:#64748b;margin-top:.15rem}.protocol-qty-pill{display:inline-flex!important;align-items:center;gap:.4rem;border-radius:999px;background:#dcfce7;color:#166534;border:1px solid #86efac;padding:.35rem .7rem;font-weight:900;white-space:nowrap}.protocol-qty-pill em{font-style:normal;font-size:.68rem;text-transform:uppercase;letter-spacing:.08em}.protocol-top-peptide-metrics{display:grid;grid-template-columns:repeat(5,minmax(80px,1fr));gap:.65rem;margin-top:.85rem}.protocol-top-peptide-metrics span{border-radius:14px;background:#f8fafc;border:1px solid #eef2f7;padding:.55rem;color:#0f172a;font-weight:800}.protocol-fold-body{border-top:1px solid #e5e7eb;background:#fbfdff}.protocol-section-head{display:flex;justify-content:space-between;align-items:flex-start}.protocol-report-v3 .protocol-phase-card{border:1px solid #e5e7eb;border-radius:22px;background:#fff;overflow:hidden;box-shadow:0 12px 32px rgba(15,23,42,.05)}.protocol-report-v3 .phase-mini-stats{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:.75rem}.protocol-report-v3 .phase-mini-stats>div{border:1px solid #e5e7eb;border-radius:16px;padding:.75rem;background:#fff}.protocol-report-v3 .phase-mini-stats span{display:block;color:#64748b;text-transform:uppercase;letter-spacing:.08em;font-size:.68rem;font-weight:900}.protocol-report-v3 .phase-mini-stats strong{display:block;color:#0f172a;margin-top:.2rem}.protocol-report-v3 .phase-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;border-top:1px solid #eef2f7;border-bottom:1px solid #eef2f7;background:#f8fafc}.protocol-report-v3 .protocol-table thead th{background:#f8fafc;color:#64748b;text-transform:uppercase;letter-spacing:.08em;font-size:.75rem}.protocol-report-v3 .protocol-table td,.protocol-report-v3 .protocol-table th{padding:.9rem}.protocol-report-v3 .protocol-days-badge{display:inline-block;border:1px solid #bfdbfe;background:#eff6ff;color:#1e40af;border-radius:999px;padding:.35rem .65rem;font-weight:800;white-space:nowrap}@media(max-width:1200px){.protocol-money-summary{grid-template-columns:repeat(3,1fr)}.protocol-top-peptide-metrics{grid-template-columns:repeat(2,1fr)}.protocol-report-v3 .phase-mini-stats{grid-template-columns:repeat(2,1fr)}}@media(max-width:768px){.protocol-fold-summary{padding:1rem}.protocol-fold-topline{display:block}.protocol-fold-actions{margin-top:1rem}.protocol-money-summary,.protocol-top-peptide-grid,.protocol-report-v3 .phase-mini-stats{grid-template-columns:1fr}.protocol-top-peptide-head{display:block}.protocol-qty-pill{margin-top:.65rem}}@media print{.protocol-fold-card{break-inside:avoid;box-shadow:none}.protocol-fold-card:not([open]) .protocol-fold-body{display:block}.protocol-expand-pill,.protocol-fold-actions{display:none!important}.protocol-fold-summary{padding:1rem;background:#fff}.protocol-top-peptide-card,.protocol-money-summary>div{box-shadow:none}}

/* Client Protocol Report: explicit per-protocol QTY summary */
.protocol-summary-qty-panel{
    margin-top:1rem;
    border:1px solid #bfdbfe;
    border-radius:22px;
    background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
    overflow:hidden;
    box-shadow:0 14px 34px rgba(37,99,235,.07);
}
.protocol-summary-qty-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:1rem;
    padding:1rem 1.1rem;
    border-bottom:1px solid #e5efff;
}
.protocol-summary-qty-table thead th{
    background:#f1f7ff;
    color:#64748b;
    text-transform:uppercase;
    letter-spacing:.08em;
    font-size:.72rem;
    font-weight:900;
    border-bottom:1px solid #dbeafe;
    white-space:nowrap;
}
.protocol-summary-qty-table td,
.protocol-summary-qty-table th{
    padding:.85rem 1rem;
    vertical-align:middle;
}
.protocol-summary-qty-table tbody tr:not(:last-child) td{
    border-bottom:1px solid #eef2f7;
}
.protocol-qty-pill-lg{
    font-size:1rem;
    padding:.48rem .85rem;
    box-shadow:0 10px 24px rgba(22,101,52,.12);
}
.protocol-qty-pill-lg em{
    font-size:.7rem;
}
@media(max-width:992px){
    .protocol-summary-qty-table{min-width:900px;}
    .protocol-summary-qty-head{display:block;}
    .protocol-summary-qty-head .badge{margin-top:.75rem;}
}
@media print{
    .protocol-summary-qty-panel{box-shadow:none;break-inside:avoid;}
    .protocol-summary-qty-table thead th{background:#fff!important;}
}

/* Protocol report: visible QTY summary + phase actions */
.protocol-qty-at-glance{
    margin:1rem 0;
    border:1px solid #bbf7d0;
    border-radius:22px;
    background:linear-gradient(135deg,#f0fdf4 0%,#ffffff 68%);
    padding:1rem;
    box-shadow:0 14px 35px rgba(22,101,52,.08);
}
.protocol-qty-at-glance-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:1rem;
    margin-bottom:.85rem;
}
.protocol-qty-chip-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:.85rem;
}
.protocol-qty-chip-card{
    border:1px solid #bbf7d0;
    background:#fff;
    border-radius:20px;
    padding:.9rem;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:.75rem;
    align-items:center;
}
.protocol-qty-chip-title strong{display:block;color:#0f172a;font-size:1rem;line-height:1.15;}
.protocol-qty-chip-title span{display:block;color:#64748b;font-size:.82rem;margin-top:.18rem;}
.protocol-qty-chip-value{
    display:inline-flex;
    align-items:center;
    gap:.5rem;
    border-radius:999px;
    background:#dcfce7;
    border:1px solid #86efac;
    color:#166534;
    padding:.55rem .8rem;
    white-space:nowrap;
}
.protocol-qty-chip-value span{font-size:.68rem;text-transform:uppercase;letter-spacing:.1em;font-weight:900;}
.protocol-qty-chip-value strong{font-size:1.05rem;}
.protocol-qty-chip-meta{
    grid-column:1 / -1;
    display:flex;
    flex-wrap:wrap;
    gap:.5rem;
    color:#475569;
    font-size:.82rem;
    font-weight:700;
}
.protocol-qty-chip-meta span{border-radius:999px;background:#f8fafc;border:1px solid #e2e8f0;padding:.25rem .55rem;}
.phase-action-panel{
    display:flex;
    align-items:center;
    gap:.5rem;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.phase-action-panel form{display:inline-flex;margin:0;}
.protocol-report-v3 .phase-mini-stats-pro{grid-template-columns:repeat(4,minmax(120px,1fr));}
.phase-danger-card{border-color:#fecaca!important;box-shadow:0 18px 45px rgba(220,38,38,.08)!important;}
@media(max-width:900px){
    .protocol-qty-at-glance-head{display:block;}
    .protocol-qty-at-glance-head .badge{margin-top:.65rem;}
    .protocol-qty-chip-card{grid-template-columns:1fr;}
    .phase-action-panel{justify-content:flex-start;width:100%;}
}
@media print{
    .protocol-qty-at-glance{box-shadow:none;break-inside:avoid;}
    .phase-action-panel{display:none!important;}
}

/* Protocol report: show decimal QTY used separately from rounded dispense quantity */
.protocol-qty-chip-value-split{
    align-items:flex-start;
    flex-direction:column;
    gap:.15rem;
    border-radius:18px;
    padding:.6rem .85rem;
}
.protocol-qty-chip-value-split small{
    color:#166534;
    font-weight:800;
    opacity:.88;
}
.protocol-qty-pill-blue{
    background:#dbeafe!important;
    border-color:#93c5fd!important;
    color:#1d4ed8!important;
}

/* PepCal protocol management workspace */
.protocol-manage-toolbar .eyebrow,
.protocol-manage-hero .report-kicker,
.protocol-phase-manager .report-kicker,
.protocol-edit-card .report-kicker{
    letter-spacing:.12em;
}
.protocol-manage-hero{
    border:1px solid #dbeafe;
    border-radius:28px;
    background:linear-gradient(135deg,#ffffff 0%,#f8fbff 68%,#eef6ff 100%);
    box-shadow:0 24px 60px rgba(37,99,235,.09);
    padding:1.25rem;
    display:grid;
    grid-template-columns:minmax(280px,1.1fr) minmax(0,2fr);
    gap:1.25rem;
    align-items:stretch;
}
.protocol-manage-hero-main{
    border:1px solid #e5efff;
    border-radius:22px;
    background:#fff;
    padding:1.15rem;
}
.protocol-manage-hero-main h3{
    margin:.35rem 0 .25rem;
    color:#0f172a;
    font-size:1.35rem;
    line-height:1.2;
}
.protocol-manage-hero-main p{
    margin:0;
    color:#64748b;
    font-weight:700;
}
.protocol-manage-stat-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:.8rem;
}
.protocol-manage-stat-grid>div{
    border:1px solid #e5e7eb;
    border-radius:18px;
    background:#fff;
    padding:.9rem 1rem;
    min-height:84px;
}
.protocol-manage-stat-grid span{
    display:block;
    color:#64748b;
    font-size:.72rem;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.09em;
}
.protocol-manage-table thead th{
    color:#64748b;
    font-size:.72rem;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.09em;
}
.protocol-manage-stat-grid strong{
    display:block;
    margin-top:.32rem;
    color:#0f172a;
    font-size:1.05rem;
}
.protocol-edit-card,
.protocol-phase-manager{
    border:1px solid #dbeafe!important;
    border-radius:24px!important;
    box-shadow:0 18px 45px rgba(15,23,42,.06)!important;
    overflow:hidden;
}
.protocol-delete-warning{
    display:flex;
    gap:.85rem;
    align-items:flex-start;
    border:1px solid #fecaca;
    background:linear-gradient(135deg,#fff5f5,#ffffff);
    color:#991b1b;
    border-radius:18px;
    padding:1rem;
}
.protocol-delete-warning i{
    font-size:1.35rem;
    line-height:1;
    margin-top:.08rem;
}
.protocol-delete-warning strong{
    display:block;
    color:#7f1d1d;
    margin-bottom:.2rem;
}
.protocol-delete-warning span{
    display:block;
    color:#7f1d1d;
    opacity:.82;
    line-height:1.45;
}
.protocol-manage-table thead th{
    background:#f8fafc;
    border-bottom:1px solid #e5e7eb;
    white-space:nowrap;
}
.protocol-manage-table td,
.protocol-manage-table th{
    padding:1rem 1.15rem;
    vertical-align:middle;
}
.protocol-manage-table tbody tr:not(:last-child) td{
    border-bottom:1px solid #eef2f7;
}
.protocol-manage-table tbody tr:hover td{
    background:#fbfdff;
}
.phase-manage-stat-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
}
.phase-action-panel form,
.protocol-fold-actions form{
    display:inline-flex;
    margin:0;
}
@media(max-width:1100px){
    .protocol-manage-hero{grid-template-columns:1fr;}
    .protocol-manage-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
    .phase-manage-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:650px){
    .protocol-manage-stat-grid,
    .phase-manage-stat-grid{grid-template-columns:1fr;}
    .protocol-manage-table{min-width:850px;}
}
@media print{
    .protocol-manage-toolbar,
    .protocol-delete-warning,
    .phase-action-panel,
    .protocol-fold-actions form{display:none!important;}
    .protocol-manage-hero,
    .protocol-edit-card,
    .protocol-phase-manager{box-shadow:none!important;}
}

/* Purchase workflow / Odoo-style purchase stages */
.purchase-workflow-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.85rem}
.workflow-step{border:1px solid #dbe5f5;background:#fff;border-radius:20px;padding:1rem;display:flex;align-items:center;gap:.75rem;box-shadow:0 12px 28px rgba(15,23,42,.05)}
.workflow-step strong{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:999px;background:#eef4ff;color:#1d4ed8;font-weight:900}
.workflow-step span{display:block;font-weight:900;color:#0f172a}.workflow-step small{display:block;color:#64748b;font-weight:600}.workflow-step.active{border-color:#60a5fa;background:linear-gradient(135deg,#eff6ff,#fff);box-shadow:0 18px 40px rgba(37,99,235,.13)}.workflow-step.active strong{background:#2563eb;color:#fff}
@media(max-width:768px){.purchase-workflow-strip{grid-template-columns:1fr}.workflow-step{align-items:flex-start}}

/* Client-friendly protocol print */
.client-friendly-protocol-sheet{display:none;color:#0f172a}.client-friendly-protocol-sheet *{box-sizing:border-box}.client-protocol-cover-print,.client-print-overview-panel,.client-print-protocol-card,.client-print-phase-card,.client-print-line-card,.client-print-footer-note{background:#fff;border:1px solid #d7e3f1;border-radius:26px;box-shadow:0 18px 45px rgba(15,23,42,.06)}.client-protocol-cover-print{padding:1.55rem;margin-bottom:1.15rem;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(360px,.8fr);gap:1rem;align-items:stretch;background:radial-gradient(circle at top left,#eaf3ff 0,#fff 42%,#f8fbff 100%)}.client-cover-main{display:flex;flex-direction:column;justify-content:center}.client-protocol-cover-print h1{font-size:2.15rem;line-height:1.05;margin:.2rem 0;color:#0b1220;letter-spacing:-.03em}.client-cover-subtitle{margin:0;color:#475569;font-weight:800}.client-confidential-pill{display:inline-flex;align-items:center;width:max-content;margin-top:.9rem;border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:.42rem .78rem;font-weight:900;font-size:.78rem}.client-print-info-grid,.client-overview-stat-grid,.client-dose-grid,.client-phase-meta,.client-print-counts{display:grid;gap:.65rem}.client-print-info-grid{grid-template-columns:repeat(2,minmax(130px,1fr))}.client-print-info-grid div,.client-dose-grid div,.client-phase-meta div,.client-print-counts div,.client-overview-stat-grid div{border:1px solid #e2e8f0;background:#f8fafc;border-radius:16px;padding:.75rem;min-width:0}.client-print-info-grid span,.client-dose-grid span,.client-phase-meta span,.client-print-counts span,.client-overview-stat-grid span,.client-print-protocol-head>div:first-child>span,.client-print-phase-head>div:first-child>span,.client-dose-chip span,.client-print-section-title span,.client-line-eyebrow,.client-schedule-title-row span{display:block;text-transform:uppercase;letter-spacing:.08em;font-size:.68rem;color:#64748b;font-weight:950}.client-print-info-grid strong,.client-dose-grid strong,.client-phase-meta strong,.client-print-counts strong,.client-overview-stat-grid strong,.client-dose-chip strong{display:block;color:#0f172a;margin-top:.18rem;line-height:1.2}.client-print-overview-panel{padding:1.15rem;margin-bottom:1.15rem}.client-print-section-title h2,.client-print-section-title h3{color:#0f172a;margin:.15rem 0 .2rem;letter-spacing:-.02em}.client-print-section-title h2{font-size:1.35rem}.client-print-section-title h3{font-size:1.05rem}.client-print-section-title p{margin:0;color:#64748b;font-weight:650;max-width:900px}.client-print-section-title.compact{margin-bottom:.75rem}.client-overview-stat-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:1rem}.client-overview-stat-grid strong{font-size:1.35rem;color:#1d4ed8}.client-print-protocol-card{padding:1.25rem;margin-bottom:1.25rem;break-inside:avoid}.client-print-protocol-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.55fr);gap:1rem;align-items:start;border-bottom:1px solid #e2e8f0;padding-bottom:1rem;margin-bottom:1rem}.client-print-protocol-head h2{font-size:1.5rem;margin:.1rem 0;color:#0f172a;letter-spacing:-.02em}.client-print-protocol-head p{margin:0;color:#475569;font-weight:750}.client-print-counts{grid-template-columns:repeat(3,minmax(82px,1fr));text-align:center}.client-print-counts strong{font-size:1.35rem;color:#1d4ed8}.client-roadmap{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.65rem;margin-bottom:1rem}.client-roadmap-step{display:flex;align-items:flex-start;gap:.62rem;border:1px solid #dbeafe;background:linear-gradient(135deg,#f8fbff,#fff);border-radius:18px;padding:.75rem}.client-roadmap-step>strong{display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;width:34px;height:34px;border-radius:999px;background:#2563eb;color:#fff;font-weight:950}.client-roadmap-step span{display:block;font-weight:950;color:#0f172a}.client-roadmap-step small{display:block;color:#64748b;font-weight:750;line-height:1.35}.client-print-dispense-panel{border:1px solid #e2e8f0;background:#fbfdff;border-radius:22px;padding:1rem;margin-bottom:1rem}.client-dispense-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.65rem}.client-dispense-card{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:.75rem}.client-dispense-card strong{display:block;color:#0f172a}.client-dispense-card span{display:block;color:#475569;font-weight:750;margin-top:.18rem}.client-print-phase-card{padding:1rem;margin-top:1rem;background:#fbfdff;break-inside:avoid}.client-print-phase-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(430px,.9fr);gap:1rem;align-items:start;margin-bottom:1rem}.client-print-phase-head h3{font-size:1.22rem;margin:.1rem 0;color:#0f172a}.client-phase-meta{grid-template-columns:repeat(3,minmax(110px,1fr))}.client-print-line-card{padding:1rem;margin:.85rem 0;break-inside:avoid;border-radius:22px}.client-line-title-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,.28fr);gap:1rem;align-items:start;margin-bottom:.9rem}.client-line-title-row h4{font-size:1.18rem;margin:.05rem 0;color:#0f172a;letter-spacing:-.01em}.client-line-title-row p{margin:.25rem 0 0;color:#475569;font-weight:750;line-height:1.45}.client-line-eyebrow{color:#1d4ed8!important}.client-dose-chip{border:1px solid #bfdbfe;background:#eff6ff;border-radius:18px;padding:.75rem;text-align:center}.client-dose-chip strong{color:#1e40af;font-size:1.1rem}.client-dose-chip small{display:block;margin-top:.25rem;color:#1e3a8a;font-weight:750;line-height:1.35}.client-dose-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:.95rem}.client-dose-grid strong{font-size:.95rem}.client-schedule-title-row{display:flex;justify-content:space-between;gap:1rem;align-items:end;margin:.3rem 0 .55rem}.client-schedule-title-row strong{display:block;color:#0f172a;font-size:.95rem}.client-schedule-title-row>div:last-child{border:1px solid #e2e8f0;background:#f8fafc;border-radius:999px;padding:.32rem .65rem;color:#475569;font-weight:900;font-size:.8rem}.client-schedule-table{width:100%;border-collapse:separate;border-spacing:0;border:1px solid #dbe5f0;border-radius:16px;overflow:hidden;background:#fff}.client-schedule-table th{background:#eef4fb;color:#475569;text-transform:uppercase;letter-spacing:.06em;font-size:.7rem;white-space:nowrap}.client-schedule-table th,.client-schedule-table td{padding:.62rem .7rem;border-bottom:1px solid #e2e8f0;vertical-align:top}.client-schedule-table tr:last-child td{border-bottom:0}.client-schedule-table td{font-weight:650;color:#1f2937}.client-line-note{margin-top:.75rem;background:#fffbeb;border:1px solid #fde68a;border-radius:14px;padding:.7rem;color:#713f12;font-weight:650}.client-print-footer-note{padding:1rem;margin-top:1.1rem;background:linear-gradient(135deg,#fff,#f8fafc);font-weight:700;color:#334155}.client-print-footer-note strong{color:#0f172a}.client-signature-row{display:grid;grid-template-columns:1fr 1fr .7fr;gap:1rem;margin-top:1.6rem}.client-signature-row div{border-top:1px solid #94a3b8;padding-top:.45rem;min-height:34px}.client-signature-row span{font-size:.78rem;font-weight:900;color:#64748b;text-transform:uppercase;letter-spacing:.08em}
@media(max-width:992px){.client-protocol-cover-print,.client-print-protocol-head,.client-print-phase-head,.client-line-title-row{grid-template-columns:1fr}.client-print-info-grid,.client-print-counts,.client-phase-meta,.client-dose-grid,.client-overview-stat-grid{grid-template-columns:1fr}.client-confidential-pill{width:auto}.client-schedule-title-row{display:block}.client-schedule-title-row>div:last-child{display:inline-block;margin-top:.45rem}}
@media print{
    @page{size:A4;margin:11mm 10mm}
    body.client-friendly-print-mode{background:#fff!important;color:#0f172a!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
    body.client-friendly-print-mode .no-print,body.client-friendly-print-mode .sidebar,body.client-friendly-print-mode .topbar,body.client-friendly-print-mode .protocol-cover,body.client-friendly-print-mode .protocol-fold-stack,body.client-friendly-print-mode .footer{display:none!important}
    body.client-friendly-print-mode .client-friendly-protocol-sheet{display:block!important;width:100%!important;max-width:none!important;margin:0!important}
    body.client-friendly-print-mode .app-shell{display:block!important}body.client-friendly-print-mode .main{margin:0!important;width:100%!important}body.client-friendly-print-mode .content-area{padding:0!important;background:#fff!important;width:100%!important}
    body.client-friendly-print-mode .client-protocol-cover-print,body.client-friendly-print-mode .client-print-overview-panel,body.client-friendly-print-mode .client-print-protocol-card,body.client-friendly-print-mode .client-print-phase-card,body.client-friendly-print-mode .client-print-line-card,body.client-friendly-print-mode .client-print-footer-note{box-shadow:none!important;border-color:#cbd5e1!important}
    body.client-friendly-print-mode .client-protocol-cover-print{grid-template-columns:1.1fr .9fr;page-break-after:avoid;padding:1rem;border-radius:18px;margin-bottom:.7rem}
    body.client-friendly-print-mode .client-protocol-cover-print h1{font-size:1.65rem}
    body.client-friendly-print-mode .client-print-overview-panel{padding:.8rem;margin-bottom:.8rem;border-radius:18px}
    body.client-friendly-print-mode .client-overview-stat-grid{grid-template-columns:repeat(4,1fr);gap:.45rem}
    body.client-friendly-print-mode .client-print-info-grid{grid-template-columns:repeat(2,1fr);gap:.45rem}
    body.client-friendly-print-mode .client-print-info-grid div,body.client-friendly-print-mode .client-dose-grid div,body.client-friendly-print-mode .client-phase-meta div,body.client-friendly-print-mode .client-print-counts div,body.client-friendly-print-mode .client-overview-stat-grid div{padding:.5rem;border-radius:12px}
    body.client-friendly-print-mode .client-print-protocol-card{page-break-before:auto;padding:.9rem;border-radius:18px;margin-bottom:.9rem}
    body.client-friendly-print-mode .client-print-protocol-head{grid-template-columns:1fr 300px;padding-bottom:.7rem;margin-bottom:.75rem}
    body.client-friendly-print-mode .client-print-protocol-head h2{font-size:1.25rem}
    body.client-friendly-print-mode .client-print-counts{grid-template-columns:repeat(3,1fr)}
    body.client-friendly-print-mode .client-roadmap{grid-template-columns:repeat(3,1fr);gap:.45rem}
    body.client-friendly-print-mode .client-roadmap-step{padding:.5rem;border-radius:13px}
    body.client-friendly-print-mode .client-print-dispense-panel{padding:.7rem;border-radius:15px;margin-bottom:.75rem}
    body.client-friendly-print-mode .client-dispense-grid{grid-template-columns:repeat(2,1fr);gap:.45rem}
    body.client-friendly-print-mode .client-print-phase-card{padding:.75rem;margin-top:.75rem;border-radius:16px;break-inside:avoid}
    body.client-friendly-print-mode .client-print-phase-head{grid-template-columns:1fr 390px;margin-bottom:.7rem}
    body.client-friendly-print-mode .client-phase-meta{grid-template-columns:repeat(3,1fr);gap:.45rem}
    body.client-friendly-print-mode .client-print-line-card{padding:.75rem;margin:.6rem 0;border-radius:16px;break-inside:avoid}
    body.client-friendly-print-mode .client-line-title-row{grid-template-columns:1fr 170px;margin-bottom:.65rem}
    body.client-friendly-print-mode .client-dose-grid{grid-template-columns:repeat(3,1fr);gap:.45rem;margin-bottom:.65rem}
    body.client-friendly-print-mode .client-schedule-table th,body.client-friendly-print-mode .client-schedule-table td{padding:.42rem .5rem;font-size:.82rem}
    body.client-friendly-print-mode .client-print-line-card,body.client-friendly-print-mode .client-print-phase-card,.client-print-dispense-panel{break-inside:avoid;page-break-inside:avoid}
    body.client-friendly-print-mode .client-signature-row{grid-template-columns:1fr 1fr .7fr}
    body.admin-protocol-print-mode .client-friendly-protocol-sheet{display:none!important}
}


/* PepCalc global professional UI enhancements: searchable selects + smart tables */
.pepcalc-pro-select-original {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.pepcalc-pro-select {
    position: relative;
    width: 100%;
    min-width: 0;
    --pepcalc-pro-border: #d7deea;
    --pepcalc-pro-blue: #2563eb;
    --pepcalc-pro-soft: #f8fafc;
    --pepcalc-pro-text: #1f2937;
    --pepcalc-pro-muted: #64748b;
}
.pepcalc-pro-select-control {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--pepcalc-pro-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    color: var(--pepcalc-pro-text);
    padding: 9px 42px 9px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    text-align: left;
}
.pepcalc-pro-select-control:hover {
    border-color: #b8c4d6;
    background: #fff;
}
.pepcalc-pro-select.is-open .pepcalc-pro-select-control,
.pepcalc-pro-select-control:focus {
    border-color: var(--pepcalc-pro-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    outline: none;
}
.pepcalc-pro-select-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--pepcalc-pro-muted);
}
.pepcalc-pro-select.has-value .pepcalc-pro-select-value {
    color: var(--pepcalc-pro-text);
    font-weight: 600;
}
.pepcalc-pro-select-clear,
.pepcalc-pro-select-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.pepcalc-pro-select-clear {
    right: 34px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 17px;
    line-height: 1;
}
.pepcalc-pro-select-clear:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.pepcalc-pro-select-icon {
    right: 12px;
    font-size: 12px;
    pointer-events: none;
}
.pepcalc-pro-select-menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 2100;
    display: none;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .18), 0 6px 18px rgba(15, 23, 42, .10);
    overflow: hidden;
}
.pepcalc-pro-select.is-open .pepcalc-pro-select-menu {
    display: block;
}
.pepcalc-pro-select-search-wrap {
    padding: 10px;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
}
.pepcalc-pro-select-search {
    width: 100%;
    min-height: 38px;
    border: 1px solid #dbe3ef;
    border-radius: 11px;
    padding: 8px 11px;
    outline: none;
    font-size: 13px;
    background: #fff;
}
.pepcalc-pro-select-search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.pepcalc-pro-select-list {
    max-height: 280px;
    overflow: auto;
    padding: 6px;
}
.pepcalc-pro-select-option {
    width: 100%;
    border: 0;
    background: transparent;
    color: #1f2937;
    border-radius: 11px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    font-size: 13px;
}
.pepcalc-pro-select-option:hover,
.pepcalc-pro-select-option.is-active {
    background: #eef4ff;
    color: #1d4ed8;
}
.pepcalc-pro-select-option[aria-selected="true"] {
    background: #e0ecff;
    color: #1d4ed8;
    font-weight: 700;
}
.pepcalc-pro-check {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    background: #fff;
}
.pepcalc-pro-select-option[aria-selected="true"] .pepcalc-pro-check {
    background: #2563eb;
    border-color: #2563eb;
}
.pepcalc-pro-select-group {
    padding: 8px 10px 4px;
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.pepcalc-pro-select-empty {
    padding: 14px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}
.modal .pepcalc-pro-select-menu,
.offcanvas .pepcalc-pro-select-menu {
    z-index: 2200;
}
.table.pepcalc-pro-table-lite,
.pepcalc-pro-table-shell .table {
    border-collapse: separate;
    border-spacing: 0;
}
.pepcalc-pro-table-shell {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .06);
    overflow: hidden;
    margin-bottom: 1rem;
}
.pepcalc-pro-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.pepcalc-pro-table-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: #0f172a;
}
.pepcalc-pro-table-title i {
    color: #2563eb;
}
.pepcalc-pro-table-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.pepcalc-pro-table-search {
    width: min(320px, 58vw);
    border-radius: 12px;
}
.pepcalc-pro-table-size {
    width: 125px;
    border-radius: 12px;
}
.pepcalc-pro-table-scroll {
    overflow-x: auto;
}
.pepcalc-pro-table-shell table {
    margin-bottom: 0 !important;
}
.pepcalc-pro-table-shell thead th,
.table.pepcalc-pro-table-lite thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.pepcalc-pro-table-shell tbody tr,
.table.pepcalc-pro-table-lite tbody tr {
    transition: background .16s ease, box-shadow .16s ease;
}
.pepcalc-pro-table-shell tbody tr:hover,
.table.pepcalc-pro-table-lite tbody tr:hover {
    background: #f8fafc;
}
.pepcalc-pro-table-shell td,
.pepcalc-pro-table-shell th,
.table.pepcalc-pro-table-lite td,
.table.pepcalc-pro-table-lite th {
    vertical-align: middle;
}
.pepcalc-pro-table-shell .btn,
.table.pepcalc-pro-table-lite .btn {
    border-radius: 10px;
}
.pepcalc-pro-table-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.pepcalc-pro-table-info {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}
.pepcalc-pro-table-buttons {
    display: flex;
    gap: 8px;
}
@media (max-width: 768px) {
    .pepcalc-pro-select-menu {
        min-width: min(92vw, 420px) !important;
        max-width: min(92vw, 420px) !important;
    }
    .pepcalc-pro-table-toolbar,
    .pepcalc-pro-table-pager {
        align-items: stretch;
        flex-direction: column;
    }
    .pepcalc-pro-table-tools,
    .pepcalc-pro-table-buttons {
        width: 100%;
    }
    .pepcalc-pro-table-search,
    .pepcalc-pro-table-size,
    .pepcalc-pro-table-buttons .btn {
        width: 100%;
    }
}

/* === MedCalc Inventory searchable dropdown clipping fix ===
   Scope: Inventory/current stock page only.
   The global enterprise card intentionally clips its contents to preserve
   rounded corners. While a professional searchable select is open, allow
   that one filter card to overflow so the complete options list can render.
   No inventory data, filters, tables, calculations or other pages are changed. */
body:has(select[name="vendor_id"]):has(select[name="type_id"]):has(select[name="stock_status"])
.enterprise-card:has(.pepcalc-pro-select.is-open),
body:has(select[name="vendor_id"]):has(select[name="type_id"]):has(select[name="stock_status"])
.card:has(.pepcalc-pro-select.is-open) {
    overflow: visible !important;
    position: relative;
    z-index: 2110;
}

body:has(select[name="vendor_id"]):has(select[name="type_id"]):has(select[name="stock_status"])
.pepcalc-pro-select.is-open {
    z-index: 2115;
}

body:has(select[name="vendor_id"]):has(select[name="type_id"]):has(select[name="stock_status"])
.pepcalc-pro-select.is-open .pepcalc-pro-select-menu {
    z-index: 2120;
}
