/* Client portal demo popup (Views/Home/_PortalDemo.cshtml) */
.portal-demo {
    --pd-ink: #0f172a; --pd-muted: #64748b; --pd-line: #e2e8f0; --pd-soft: #f8fafc;
    --pd-ok: #059669; --pd-info: #2563eb; --pd-warn: #d97706; --pd-down: #dc2626;
}
.portal-demo .modal-content { border: 0; border-radius: 18px; overflow: hidden; background: #fff; color: var(--pd-ink); }
.pd-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--pd-line); }
.pd-head > div { flex: 1; min-width: 0; }
.pd-kicker { margin: 0 0 2px; font-family: 'JetBrains Mono', monospace; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--pd-info); }
.pd-title { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.pd-sample { align-self: center; white-space: nowrap; font-size: .75rem; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 4px 10px; }

.pd-stage { position: relative; padding: 16px 22px 4px; background: #eef2f7; touch-action: pan-y; }
.pd-slide { display: none; }
.pd-slide.is-active { display: block; animation: pd-in .28s ease; }
@keyframes pd-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pd-slide.is-active { animation: none; } }
.pd-caption { margin: 10px 2px 8px; font-size: .9rem; color: var(--pd-muted); text-align: center; }

/* Fake portal window */
.pd-screen { display: grid; grid-template-columns: 170px 1fr; min-height: 470px; background: #fff; border: 1px solid var(--pd-line); border-radius: 14px; box-shadow: 0 12px 30px rgba(15, 23, 42, .08); overflow: hidden; }
.pd-side { background: #0b1220; color: #cbd5e1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; font-size: .82rem; }
.pd-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; margin: 0 4px 12px; }
.pd-brand .brand-icon { width: 26px; height: 26px; font-size: .7rem; }
.pd-side-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; }
.pd-side-item.is-active { background: rgba(37, 99, 235, .25); color: #fff; font-weight: 600; }
.pd-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; background: var(--pd-soft); }
.pd-screen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pd-screen-head h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }

.pd-card { background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; padding: 12px 14px; min-width: 0; font-size: .86rem; }
.pd-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pd-card-head h4 { margin: 0; font-size: .88rem; font-weight: 700; }
.pd-muted { color: var(--pd-muted); font-size: .8rem; }
.pd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pd-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pd-kpi { background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pd-kpi span { font-size: .74rem; color: var(--pd-muted); }
.pd-kpi strong { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.pd-kpi em { font-style: normal; font-size: .74rem; color: var(--pd-muted); }
.pd-kpi em.up { color: var(--pd-ok); }

.pd-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.pd-pill.ok { background: #d1fae5; color: #065f46; }
.pd-pill.info { background: #dbeafe; color: #1e40af; }
.pd-pill.warn { background: #fef3c7; color: #92400e; }
.pd-btn { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: #fff; background: var(--pd-info); border-radius: 8px; padding: 5px 11px; }
.pd-btn.ghost { background: #fff; color: var(--pd-info); border: 1px solid #bfdbfe; margin-top: 8px; }

.ok { --c: var(--pd-ok); } .info { --c: var(--pd-info); } .warn { --c: var(--pd-warn); } .down { --c: var(--pd-down); }
.portal-demo i.ok, .portal-demo i.info, .portal-demo i.warn, .portal-demo i.down { color: var(--c); }

/* Charts */
.pd-chart { width: 100%; height: 120px; display: block; overflow: visible; }
.pd-chart .grid { stroke: var(--pd-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pd-chart .line { fill: none; stroke: var(--c); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pd-chart .area { fill: var(--c); opacity: .12; }
.pd-bars { height: 150px; }
.pd-bars .bar { fill: #93c5fd; }
.pd-bars .bar.now { fill: var(--pd-info); }
.pd-bars text { font-size: 10px; fill: var(--pd-muted); }
.pd-bars text.val { fill: var(--pd-ink); font-weight: 600; }
.pd-bars90 { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 34px; }
.pd-bars90 span { border-radius: 2px; background: var(--c); }
.pd-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--pd-muted); margin-top: 4px; }

.pd-feed, .pd-invoices, .pd-specs { list-style: none; margin: 0; padding: 0; }
.pd-feed li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.pd-feed li:last-child { border-bottom: 0; }
.pd-feed li > div { display: flex; flex-direction: column; }
.pd-feed li > div > span { font-size: .74rem; color: var(--pd-muted); }
.pd-status-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.pd-status-list > div { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--pd-line); border-radius: 10px; padding: 8px 10px; font-size: .82rem; }
.pd-status-list i { font-size: .6rem; }
.pd-status-list > div > span:last-child { margin-left: auto; color: var(--pd-muted); font-size: .74rem; text-align: right; }

.pd-progress { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.pd-progress span { display: block; height: 100%; background: var(--c); border-radius: inherit; }
.pd-project .pd-card-head { margin-bottom: 6px; }
.pd-milestones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: ms; }
.pd-milestones li { position: relative; padding-top: 22px; font-size: .78rem; color: var(--pd-muted); }
.pd-milestones li::before { counter-increment: ms; content: counter(ms); position: absolute; top: 0; left: 0; width: 18px; height: 18px; border-radius: 50%; background: #e2e8f0; color: var(--pd-muted); font-size: .66rem; font-weight: 700; display: grid; place-items: center; }
.pd-milestones li.done { color: var(--pd-ink); }
.pd-milestones li.done::before { content: "✓"; background: var(--pd-ok); color: #fff; }
.pd-milestones li.now { color: var(--pd-ink); font-weight: 600; }
.pd-milestones li.now::before { background: var(--pd-info); color: #fff; }

.pd-table { background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; overflow: hidden; font-size: .82rem; }
.pd-tr { display: grid; grid-template-columns: 56px 2.4fr 1fr 1.3fr 1fr; gap: 8px; align-items: center; padding: 9px 12px; border-top: 1px solid #f1f5f9; }
.pd-th { border-top: 0; background: #f8fafc; font-size: .72rem; font-weight: 700; color: var(--pd-muted); text-transform: uppercase; letter-spacing: .04em; }
.pd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; }

.pd-invoices li { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: .82rem; }
.pd-tech { display: flex; gap: 12px; align-items: flex-start; }
.pd-avatar { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-weight: 800; display: grid; place-items: center; }
.pd-specs li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.pd-specs i { color: var(--pd-info); }
.pd-faq details { background: #fff; border: 1px solid var(--pd-line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: .86rem; }
.pd-faq summary { font-weight: 600; cursor: pointer; }
.pd-faq details p { margin: 8px 0 0; color: #334155; }

/* Slide controls */
.pd-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--pd-line); }
.pd-arrow { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--pd-line); background: #fff; color: var(--pd-ink); display: grid; place-items: center; }
.pd-arrow:hover, .pd-arrow:focus-visible { border-color: var(--pd-info); color: var(--pd-info); }
.pd-tabs { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; justify-content: center; }
.pd-tabs::-webkit-scrollbar { display: none; }
.pd-tab { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--pd-muted); font-size: .8rem; font-weight: 600; padding: 7px 10px; border-radius: 999px; }
.pd-tab.is-active { background: #dbeafe; color: #1e40af; }
.pd-tab:hover { color: var(--pd-ink); }
.pd-cta { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 14px 14px; font-size: .9rem; font-weight: 600; flex-wrap: wrap; }

/* Demo launch buttons on the login page */
.pd-launch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; font-weight: 600; font-size: .92rem; border-radius: 10px; padding: 10px 16px; }
.pd-launch:hover, .pd-launch:focus-visible { background: #dbeafe; color: #1e3a8a; }

@media (max-width: 991.98px) {
    .pd-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767.98px) {
    .pd-head { padding: 14px 14px 10px; flex-wrap: wrap; }
    .pd-sample { order: 3; }
    .pd-stage { padding: 12px 10px 2px; }
    .pd-screen { grid-template-columns: 1fr; min-height: 0; }
    .pd-side { display: none; }
    .pd-body { padding: 12px; }
    .pd-grid-2, .pd-grid-3 { grid-template-columns: 1fr; }
    .pd-tab span { display: none; }
    .pd-tab.is-active span { display: inline; }
    .pd-tabs { justify-content: flex-start; }
    .pd-tr { grid-template-columns: 1fr auto; }
    .pd-tr > span:nth-child(1), .pd-tr > span:nth-child(3), .pd-tr > span:nth-child(5) { display: none; }
    .pd-milestones { grid-template-columns: repeat(2, 1fr); }
    .pd-invoices li { grid-template-columns: 1fr auto auto; }
    .pd-invoices li > span:nth-child(2) { display: none; }
}
