/* ==========================================================================
   Partner Portal — modern, mobile-first
   ========================================================================== */
* { box-sizing: border-box; }
body.prm-portal {
    margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa; color: #2c3e50;
}
.prm-nav {
    background: var(--prm-primary, #2C3E50); color: #fff;
    padding: 0 24px; box-shadow: 0 2px 6px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 50;
}
.prm-nav-inner { display:flex; align-items:center; justify-content:space-between; max-width: 1300px; margin: 0 auto; height: 60px; }
.prm-brand { color:#fff; text-decoration:none; font-weight:700; font-size:16px; }
.prm-brand img { height: 32px; vertical-align: middle; }
.prm-nav-links { list-style:none; display:flex; gap: 4px; margin:0; padding:0; }
.prm-nav-links a {
    color:rgba(255,255,255,.85); text-decoration:none; padding: 8px 14px;
    border-radius: 6px; transition: background .15s; font-size: 14px;
}
.prm-nav-links a:hover { background: rgba(255,255,255,.1); color:#fff; }
@media (max-width: 768px) {
    .prm-nav-inner { flex-direction: column; height: auto; padding: 8px 0; }
    .prm-nav-links { flex-wrap: wrap; justify-content: center; }
}

.prm-shell { max-width: 1480px; margin: 24px auto; padding: 0 24px; }
.prm-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.prm-alert.success { background: #d4edda; color: #155724; }
.prm-alert.error   { background: #f8d7da; color: #721c24; }

.prm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin: 16px 0; }
.prm-card { background: #fff; padding: 18px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.prm-card-label { font-size: 12px; color:#888; text-transform: uppercase; letter-spacing: .5px; }
.prm-card-value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.prm-card-sub   { font-size: 12px; color:#666; margin-top: 4px; }

.prm-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 24px; }
.prm-col-7 { grid-column: span 7; }
.prm-col-5 { grid-column: span 5; }
@media (max-width: 900px) { .prm-col-7, .prm-col-5 { grid-column: span 12; } }

.prm-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.prm-stage-card { background:#fff; padding:14px; border-radius:8px; text-align:center; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.prm-stage-name { font-size: 11px; color:#888; text-transform: uppercase; }
.prm-stage-num  { font-size: 22px; font-weight: 700; }
.prm-stage-val  { font-size: 12px; color:#666; }

.prm-table { width:100%; border-collapse: collapse; background:#fff; border-radius:10px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.prm-table th, .prm-table td { padding: 12px 14px; text-align:left; border-bottom: 1px solid #eee; font-size: 14px; }
.prm-table th { background: #fafbfc; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color:#666; }
.prm-table tbody tr:hover { background: #f9fafb; }

.prm-pill { display:inline-block; padding: 2px 8px; background:#eef1f5; color:#555; border-radius: 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.prm-pill.warn { background: #fff3cd; color: #856404; }

.prm-list { list-style:none; padding:0; margin:0; }
.prm-list li { padding:10px 14px; background:#fff; border-bottom:1px solid #eee; }
.prm-list li:first-child { border-top-left-radius:10px; border-top-right-radius:10px; }
.prm-list li:last-child  { border-bottom: none; border-bottom-left-radius:10px; border-bottom-right-radius:10px; }

.prm-history { list-style:none; padding-left: 18px; border-left: 2px solid var(--prm-primary, #2C3E50); }
.prm-history li { padding: 8px 0 8px 14px; position: relative; }
.prm-history li::before { content:""; position:absolute; left:-7px; top:13px; width:12px; height:12px; background:var(--prm-primary,#2C3E50); border-radius:50%; }

.prm-input { width:100%; padding: 10px 12px; border:1px solid #d1d8e0; border-radius: 8px; margin: 4px 0 12px; font-size: 14px; background:#fff; }
.prm-input:focus { outline:none; border-color: var(--prm-primary, #2C3E50); box-shadow: 0 0 0 3px rgba(44,62,80,.1); }
label { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 4px; display: block; }

.prm-btn { display:inline-block; padding: 10px 18px; border-radius: 8px; border:0; cursor:pointer; font-weight: 600; font-size: 14px; text-decoration:none; }
.prm-btn.primary { background: var(--prm-primary, #2C3E50); color:#fff; }
.prm-btn:not(.primary) { background:#fff; color:#2c3e50; border:1px solid #d1d8e0; }
.prm-btn.block { display:block; width:100%; }

.prm-auth-box { max-width: 400px; margin: 60px auto; padding: 32px; background:#fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.prm-auth-box.wide { max-width: 720px; }
.prm-auth-box h2 { margin-top:0; }
.prm-auth-head { display:flex; gap:14px; align-items:flex-start; margin-bottom:18px; }
.prm-auth-head > span { width:44px; height:44px; border-radius:8px; background:#eef5ff; color:var(--prm-primary,#2C3E50); display:flex; align-items:center; justify-content:center; flex:0 0 44px; }
.prm-auth-head h2 { margin:0; }
.prm-auth-head p { margin:6px 0 0; }
.prm-auth-steps { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; list-style:none; counter-reset:auth-step; padding:0; margin:0 0 18px; }
.prm-auth-steps li { counter-increment:auth-step; border:1px solid #e8edf3; border-radius:8px; padding:10px; color:#334155; font-size:12px; min-height:58px; background:#fff; }
.prm-auth-steps li::before { content:counter(auth-step); width:20px; height:20px; border-radius:50%; background:var(--prm-primary,#2C3E50); color:#fff; display:inline-flex; align-items:center; justify-content:center; margin-right:6px; font-size:11px; }
.prm-password-wrap { position:relative; }
.prm-password-wrap .prm-input { padding-right:44px; }
.prm-password-toggle { position:absolute; right:8px; top:7px; width:32px; height:32px; border:0; border-radius:6px; background:#f1f5f9; color:#334155; cursor:pointer; }

.prm-flex-between { display:flex; align-items:center; justify-content:space-between; margin-bottom: 16px; }
.prm-deal-status-card {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
    margin-bottom:16px;
}
.prm-deal-status-card > div,
.prm-workflow-card,
.prm-proposal-actions {
    background:#fff;
    border:1px solid #e8edf3;
    border-radius:10px;
    padding:18px;
    box-shadow:0 1px 3px rgba(0,0,0,.05);
}
.prm-deal-status-card span {
    display:block;
    color:#64748b;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.4px;
}
.prm-deal-status-card strong {
    display:block;
    color:#132238;
    font-size:20px;
    margin-top:4px;
}
.prm-deal-status-card p {
    margin:8px 0 0;
    color:#475569;
}
.prm-deal-status-card em {
    display:inline-block;
    margin-top:8px;
    color:#9a3412;
    font-style:normal;
    background:#fff7ed;
    border:1px solid #fed7aa;
    border-radius:6px;
    padding:5px 8px;
}
.prm-workflow-card {
    margin:16px 0;
}
.prm-workflow-card h3 {
    margin-top:0;
}
.prm-workflow-rail {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
    gap:10px;
}
.prm-workflow-step {
    display:flex;
    gap:10px;
    border:1px solid #e2e8f0;
    border-radius:8px;
    padding:12px;
    background:#fff;
    min-height:74px;
}
.prm-workflow-step span {
    width:28px;
    height:28px;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#edf1f5;
    color:#64748b;
    flex:0 0 28px;
    font-size:12px;
    font-weight:700;
}
.prm-workflow-step strong {
    display:block;
    color:#1f2937;
    font-size:13px;
    line-height:1.3;
}
.prm-workflow-step small {
    display:block;
    color:#64748b;
    margin-top:5px;
}
.prm-workflow-step.done {
    background:#f0fdf4;
    border-color:#bbf7d0;
}
.prm-workflow-step.done span {
    background:#16a34a;
    color:#fff;
}
.prm-workflow-step.current {
    background:#eff6ff;
    border-color:#93c5fd;
    box-shadow:inset 3px 0 0 var(--prm-primary,#2C3E50);
}
.prm-workflow-step.current span {
    background:var(--prm-primary,#2C3E50);
    color:#fff;
}
.prm-proposal-actions {
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:16px;
}
.prm-proposal-actions strong {
    color:#132238;
}
.prm-proposal-actions span {
    color:#64748b;
    flex:1 1 260px;
}
.prm-proposal-response-form {
    margin:0;
}
.prm-proposal-response-wide {
    display:flex;
    align-items:center;
    gap:8px;
    flex:1 1 360px;
}
.prm-proposal-response-wide .prm-input {
    margin:0;
}

.prm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.prm-course { background:#fff; padding:14px; border-radius:10px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.prm-course-head { display:flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

.prm-checklist { background:#fff; border-radius: 10px; padding: 8px; max-height: 240px; overflow:auto; margin-bottom: 12px; }
.prm-row-check { display:flex; align-items:center; padding: 8px; gap: 10px; cursor:pointer; }
.prm-row-check:hover { background: #f5f7fa; border-radius: 6px; }

.prm-muted { color: #888; font-size: 13px; }
.prm-progress-ring { width:96px; height:96px; border-radius:50%; background:conic-gradient(var(--prm-primary,#2C3E50) 70%, #e8edf3 0); display:flex; align-items:center; justify-content:center; flex-direction:column; color:#2c3e50; box-shadow:inset 0 0 0 10px #fff; }
.prm-progress-ring strong { font-size:22px; line-height:1; }
.prm-progress-ring span { font-size:11px; color:#777; text-transform:uppercase; }
.prm-timeline { list-style:none; margin:16px 0 0; padding:0 0 0 20px; border-left:2px solid #e8edf3; }
.prm-timeline li { position:relative; background:#fff; border-radius:8px; padding:14px 16px; margin-bottom:12px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.prm-timeline li::before { content:""; position:absolute; left:-27px; top:18px; width:12px; height:12px; border-radius:50%; background:var(--prm-primary,#2C3E50); box-shadow:0 0 0 4px #eef1f5; }
.prm-timeline li.is-unread { border-left:3px solid var(--prm-primary,#2C3E50); }
.prm-timeline p { margin:6px 0; color:#667; }
.prm-missing-docs { list-style:none; margin:0; padding:0; }
.prm-missing-docs li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid #edf1f5; }
.prm-missing-docs li:last-child { border-bottom:0; }
.prm-missing-docs strong { display:block; }
.prm-missing-docs small { display:block; color:#888; margin-top:2px; }
.prm-missing-docs .prm-btn { padding:7px 12px; border:1px solid #d1d8e0; background:#fff; color:#2c3e50; white-space:nowrap; }
.no-margin { margin:0; }
.prm-hp { display:none !important; }
.prm-registration-card h3,
.prm-profile-sections h3 { margin:18px 0 12px; font-size:16px; color:#132238; font-weight:700; }
.prm-security-note { background:#eef5ff; color:#244c86; border:1px solid #d7e7ff; border-radius:8px; padding:12px 14px; margin:8px 0 16px; }
.prm-profile-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.prm-profile-head h1 { margin:0; }
.prm-profile-sections { display:grid; grid-template-columns:1fr; gap:16px; margin-bottom:16px; }

.prm-bell { position:relative; }
.prm-bell span { position:absolute; top:0; right:2px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:#ef4444; color:#fff; font-size:11px; line-height:18px; text-align:center; }
.prm-enterprise-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin:10px 0 22px; }
.prm-enterprise-head h1 { margin:0; font-size:26px; color:#132238; font-weight:700; }
.prm-enterprise-head p { margin:6px 0 0; color:#64748b; }
.prm-wave { font-size:16px; color:#f59e0b; }
.prm-date-filter { background:#fff; border:1px solid #e5e7eb; color:#334155; padding:10px 14px; border-radius:8px; text-decoration:none; box-shadow:0 1px 2px rgba(15,23,42,.04); white-space:nowrap; }
.prm-enterprise-kpis { display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:16px; margin-bottom:20px; }
.prm-metric { background:#fff; border:1px solid #e8edf3; border-radius:8px; padding:20px; box-shadow:0 12px 30px rgba(15,23,42,.06); min-height:122px; position:relative; overflow:hidden; }
.prm-metric::after { content:""; position:absolute; right:-26px; bottom:-26px; width:90px; height:90px; border-radius:50%; opacity:.12; background:currentColor; }
.prm-metric i { width:44px; height:44px; border-radius:8px; display:flex; align-items:center; justify-content:center; margin-bottom:10px; font-size:20px; background:rgba(15,23,42,.06); }
.prm-metric span { display:block; color:#64748b; font-size:13px; }
.prm-metric strong { display:block; color:#0f172a; font-size:24px; line-height:1.2; margin-top:5px; }
.prm-metric small { display:block; color:#16a34a; margin-top:10px; }
.prm-metric.green { color:#22c55e; } .prm-metric.purple { color:#8b5cf6; } .prm-metric.blue { color:#3b82f6; } .prm-metric.orange { color:#f59e0b; } .prm-metric.teal { color:#14b8a6; }
.prm-enterprise-grid { display:grid; grid-template-columns:1fr 1.05fr .95fr; gap:16px; margin-bottom:16px; }
.prm-enterprise-grid.lower { grid-template-columns:1.15fr .85fr .85fr; }
.prm-widget { background:#fff; border:1px solid #e8edf3; border-radius:8px; padding:18px; box-shadow:0 12px 30px rgba(15,23,42,.06); min-width:0; }
.prm-widget.span-2 { grid-column:span 1; }
.prm-widget-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.prm-widget-head h3 { margin:0; font-size:17px; color:#0f172a; font-weight:700; }
.prm-widget-head a { color:#2563eb; font-size:13px; text-decoration:none; }
.prm-funnel { display:flex; flex-direction:column; align-items:center; gap:7px; min-height:192px; justify-content:center; }
.prm-funnel-stage { min-height:32px; color:#fff; border-radius:6px; display:flex; align-items:center; justify-content:space-between; padding:0 16px; font-weight:600; }
.prm-funnel-stage.stage-1 { background:#4f6df5; } .prm-funnel-stage.stage-2 { background:#42c987; } .prm-funnel-stage.stage-3 { background:#f5a536; } .prm-funnel-stage.stage-4 { background:#8b5cf6; } .prm-funnel-stage.stage-5 { background:#ef5261; }
.prm-widget-foot { border-top:1px solid #edf1f5; margin-top:16px; padding-top:14px; display:flex; justify-content:space-between; gap:12px; color:#64748b; }
.prm-widget-foot strong { display:block; color:#0f172a; font-size:18px; margin-top:4px; }
.prm-mini-chart { height:230px; padding:22px 10px 0; display:flex; align-items:flex-end; gap:12px; border-bottom:1px solid #e5e7eb; background:linear-gradient(to bottom, rgba(37,99,235,.06), rgba(37,99,235,0)); }
.prm-mini-chart span { flex:1; border-radius:6px 6px 0 0; background:linear-gradient(180deg,#3b82f6,#22c55e); box-shadow:0 8px 20px rgba(59,130,246,.18); }
.prm-compliance-wrap { display:flex; align-items:center; gap:24px; }
.prm-compliance-ring { width:150px; height:150px; border-radius:50%; background:conic-gradient(#22c7a9 calc(var(--score) * 1%), #e9eef5 0); display:flex; flex-direction:column; align-items:center; justify-content:center; box-shadow:inset 0 0 0 14px #fff; flex:0 0 150px; }
.prm-compliance-ring strong { font-size:34px; color:#0f172a; line-height:1; }
.prm-compliance-ring span { color:#64748b; font-size:13px; margin-top:6px; }
.prm-compliance-list { list-style:none; margin:0; padding:0; flex:1; }
.prm-compliance-list li { display:flex; justify-content:space-between; padding:8px 0; color:#334155; }
.prm-compliance-list li::before { content:""; width:10px; height:10px; border-radius:50%; margin:5px 8px 0 0; display:inline-block; flex:0 0 10px; }
.prm-compliance-list .ok::before { background:#22c55e; } .prm-compliance-list .pending::before { background:#f59e0b; } .prm-compliance-list .bad::before { background:#ef4444; } .prm-compliance-list .miss::before { background:#94a3b8; }
.prm-compliance-list .expired::before { background:#7c2d12; }
.prm-warning-box { margin-top:18px; display:grid; grid-template-columns:auto 1fr auto; gap:8px 12px; align-items:center; padding:14px; border:1px solid #fed7aa; background:#fff7ed; border-radius:8px; color:#9a3412; }
.prm-warning-box span { grid-column:2; color:#64748b; }
.prm-warning-box a { grid-row:1 / span 2; grid-column:3; border:1px solid #3b82f6; color:#2563eb; padding:8px 12px; border-radius:6px; text-decoration:none; background:#fff; }
.prm-table.clean { box-shadow:none; border-radius:0; }
.prm-status { display:inline-block; padding:5px 10px; border-radius:6px; font-size:12px; }
.prm-status.pending { background:#fff7ed; color:#c2410c; }
.prm-status.not_approved { background:#fee2e2; color:#991b1b; }
.prm-status.missing { background:#f1f5f9; color:#475569; }
.prm-status.approved { background:#dcfce7; color:#166534; }
.prm-status.rejected { background:#fee2e2; color:#991b1b; }
.prm-status.expired { background:#ffedd5; color:#7c2d12; }
.prm-status-note { display:block; margin-top:5px; color:#991b1b; max-width:320px; }
.prm-turnstile { margin:6px 0 14px; }
.prm-basic-captcha { margin:4px 0 14px; padding:14px; border:1px solid #d7e7ff; border-radius:8px; background:#f8fbff; }
.prm-basic-captcha-row { display:flex; align-items:center; gap:12px; }
.prm-basic-captcha-row span { font-weight:700; color:#132238; white-space:nowrap; }
.prm-basic-captcha-row .prm-input { margin:0; max-width:140px; }
.prm-compliance-wrap.compact { align-items:flex-start; margin-bottom:14px; }
.prm-document-health { margin-top:16px; }
.prm-icon-btn { width:30px; height:30px; border-radius:50%; background:#f1f5f9; display:inline-flex; align-items:center; justify-content:center; color:#334155; text-decoration:none; }
.prm-alert-feed { list-style:none; padding:0; margin:0; }
.prm-alert-feed li { display:flex; gap:12px; padding:12px 0; border-bottom:1px solid #edf1f5; }
.prm-alert-feed li:last-child { border-bottom:0; }
.prm-alert-feed span { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; background:#eef5ff; color:#2563eb; flex:0 0 32px; }
.prm-alert-feed span.success { background:#dcfce7; color:#16a34a; } .prm-alert-feed span.danger { background:#fee2e2; color:#dc2626; } .prm-alert-feed span.warning { background:#ffedd5; color:#ea580c; }
.prm-alert-feed p { margin:0; color:#334155; flex:1; }
.prm-alert-feed small { display:block; color:#64748b; margin-top:5px; }
@media (max-width: 1200px) {
    .prm-enterprise-kpis { grid-template-columns:repeat(2, minmax(0,1fr)); }
    .prm-enterprise-grid, .prm-enterprise-grid.lower { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
    .prm-enterprise-head { flex-direction:column; }
    .prm-enterprise-kpis { grid-template-columns:1fr; }
    .prm-compliance-wrap { flex-direction:column; align-items:flex-start; }
    .prm-auth-steps { grid-template-columns:1fr 1fr; }
    .prm-basic-captcha-row { align-items:flex-start; flex-direction:column; }
    .prm-deal-status-card { grid-template-columns:1fr; }
}
