/* IVF & Reproductive Medicine — fertility-clinic visual workflow */

.pf-ivf-workflow {
    --ivf-accent: #7c3aed;
    --ivf-accent-soft: rgba(124, 58, 237, 0.12);
    --ivf-success: #059669;
    --ivf-current: #2563eb;
    --ivf-pending: #94a3b8;
    --ivf-failed: #dc2626;
}

.pf-ivf-timeline-ribbon {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.pf-ivf-timeline-track {
    display: flex;
    gap: 0.35rem;
    min-width: min-content;
    padding: 0.5rem 0.25rem;
}

.pf-ivf-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 4.5rem;
    text-align: center;
}

.pf-ivf-stage-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--ivf-pending);
    background: #fff;
    margin-bottom: 0.35rem;
}

.pf-ivf-stage-label {
    font-size: 0.65rem;
    line-height: 1.2;
    color: var(--ivf-pending);
    max-width: 4.5rem;
}

.pf-ivf-stage--completed .pf-ivf-stage-dot {
    border-color: var(--ivf-success);
    background: var(--ivf-success);
}

.pf-ivf-stage--completed .pf-ivf-stage-label {
    color: var(--ivf-success);
}

.pf-ivf-stage--current .pf-ivf-stage-dot {
    border-color: var(--ivf-current);
    background: var(--ivf-current);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.pf-ivf-stage--current .pf-ivf-stage-label {
    color: var(--ivf-current);
    font-weight: 600;
}

.pf-ivf-stage--failed .pf-ivf-stage-dot,
.pf-ivf-stage--cancelled .pf-ivf-stage-dot {
    border-color: var(--ivf-failed);
    background: var(--ivf-failed);
}

.pf-ivf-dashboard {
    background: linear-gradient(135deg, var(--ivf-accent-soft) 0%, #fff 60%);
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.pf-ivf-dash-grid {
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
}

.pf-ivf-ovary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pf-ivf-ovary-title {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ivf-accent);
    margin-bottom: 0.35rem;
}

.pf-ivf-follicle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 2.5rem;
    align-items: center;
}

.pf-ivf-follicle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--ivf-accent-soft);
    color: var(--ivf-accent);
    border: 2px solid rgba(124, 58, 237, 0.35);
}

.pf-ivf-follicle--mid {
    width: 2.5rem;
    height: 2.5rem;
}

.pf-ivf-follicle--lead {
    width: 2.85rem;
    height: 2.85rem;
    background: var(--ivf-current);
    color: #fff;
    border-color: var(--ivf-current);
}

.pf-ivf-endo-list {
    font-size: 0.8rem;
}

.pf-ivf-endo-item {
    display: grid;
    grid-template-columns: 2rem 1fr 3.5rem;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.pf-ivf-endo-bar-wrap {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.pf-ivf-endo-bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--ivf-accent), #a78bfa);
    border-radius: 3px;
}

.pf-ivf-trigger-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.pf-ivf-trigger-row strong {
    margin-left: auto;
}

.pf-ivf-trigger-row--ok {
    color: var(--ivf-success);
}

.pf-ivf-ready-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ivf-success);
    padding: 0.35rem 0.5rem;
    background: rgba(5, 150, 105, 0.1);
    border-radius: 0.5rem;
    text-align: center;
}

.pf-ivf-embryo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: 0.5rem;
}

.pf-ivf-embryo-card {
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.pf-ivf-embryo-card--frozen {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

.pf-ivf-embryo-card--transferred {
    border-color: var(--ivf-success);
    background: rgba(5, 150, 105, 0.08);
}

.pf-ivf-embryo-card--discarded {
    opacity: 0.55;
    text-decoration: line-through;
}

.pf-ivf-embryo-id {
    display: block;
    font-weight: 700;
}

.pf-ivf-embryo-grade {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ivf-accent);
}

.pf-ivf-kpi-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 0.2rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

.pf-ivf-kpi-row:last-child {
    border-bottom: none;
}

.pf-ivf-workup-chips .badge {
    margin: 0 0.25rem 0.25rem 0;
}

/* Stimulation medication day timeline */
.pf-ivf-med-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.pf-ivf-med-track {
    display: flex;
    gap: 0.5rem;
    min-width: min-content;
}

.pf-ivf-med-day {
    flex: 0 0 4.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.35rem;
    text-align: center;
    background: #fff;
}

.pf-ivf-med-day--current {
    border-color: var(--ivf-current);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    background: rgba(37, 99, 235, 0.04);
}

.pf-ivf-med-day-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--ivf-accent);
    margin-bottom: 0.25rem;
}

.pf-ivf-med-pill {
    display: block;
    font-size: 0.6rem;
    line-height: 1.2;
    padding: 0.2rem 0.25rem;
    margin-bottom: 0.2rem;
    border-radius: 0.35rem;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.pf-ivf-med-pill--given {
    border-style: solid;
    border-color: var(--ivf-success);
    background: rgba(5, 150, 105, 0.12);
    color: var(--ivf-success);
    font-weight: 600;
}

.pf-ivf-capture-card {
    border-left: 4px solid var(--ivf-accent) !important;
}

.pf-ivf-capture-card .pf-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pf-ivf-capture-card .pf-chip-check {
    font-size: 0.75rem;
}

/* Center analytics dashboard */
.pf-ivf-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.pf-ivf-analytics-tile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.pf-ivf-analytics-tile span {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.pf-ivf-analytics-tile strong {
    font-size: 1rem;
    color: var(--ivf-accent);
}

.pf-ivf-analytics-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    height: 4rem;
    margin-top: 0.5rem;
}

.pf-ivf-analytics-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.pf-ivf-analytics-bar {
    width: 100%;
    max-width: 1.25rem;
    background: linear-gradient(180deg, #a78bfa, var(--ivf-accent));
    border-radius: 0.2rem 0.2rem 0 0;
    min-height: 2px;
}

.pf-ivf-analytics-bar-label {
    font-size: 0.55rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.pf-ivf-analytics-source {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

/* Counselling mode — emphasize visuals, de-emphasize SOAP */
.pf-ivf-counselling-mode .pf-gyn-main .pf-soap-nav,
.pf-ivf-counselling-mode .pf-gyn-main .pf-soap-fields,
.pf-ivf-counselling-mode .pf-prescription-stack {
    display: none !important;
}

.pf-ivf-counselling-mode .pf-gyn-aside {
    flex: 1 1 100%;
    max-width: 100%;
}

.pf-ivf-counselling-mode [data-pf-ivf-dashboard],
.pf-ivf-counselling-mode [data-pf-ivf-follicles],
.pf-ivf-counselling-mode [data-pf-ivf-embryology] {
    font-size: 1.05rem;
}

@media (max-width: 767.98px) {
    .pf-ivf-stage {
        min-width: 3.75rem;
    }
    .pf-ivf-stage-label {
        font-size: 0.6rem;
    }
}
