/* ArrangerOS — deal execution UI on top of the Helaplus design system */

/* ---------- Login — two-panel corporate layout ---------- */
.login-wrap { min-height: 100vh; display: flex; position: relative; }
.login-brand-panel { flex: 1.15; background: linear-gradient(160deg, #0f2a22 0%, #14322a 55%, #1a4a36 100%); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.login-logo { display: flex; align-items: center; gap: 14px; }
.login-logo-name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: rgba(255,255,255,.55); }
.login-logo-name span { color: #4ade80; }
.login-logo-sub { font-size: 12px; color: rgba(255,255,255,.6); }
.login-pitch h1 { font-size: 44px; font-weight: 800; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 26px; }
.login-rule { width: 72px; height: 1px; background: linear-gradient(90deg, #c8860a, rgba(200,134,10,.25)); margin-bottom: 14px; }
.login-tagline { font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.login-powered { position: absolute; bottom: 18px; right: 26px; font-size: 12px; color: #94a3b8; }
.login-powered a { color: #c8860a; text-decoration: none; font-weight: 600; }
.login-powered a:hover { text-decoration: underline; }
.login-deco { width: 100%; max-width: 520px; height: auto; }
.flow-dash { animation: flowdash 1.4s linear infinite; }
@keyframes flowdash { to { stroke-dashoffset: -15; } }
.flow-pulse { animation: flowpulse 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes flowpulse {
    0%, 12% { opacity: .85; transform: scale(.55); }
    24%, 100% { opacity: 0; transform: scale(1.5); }
}
.flow-label { font-size: 8px; letter-spacing: .14em; fill: rgba(255,255,255,.42); }
.login-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; background: #f1f5f4; padding: 40px; }
.login-card { background: #fff; border-radius: 14px; padding: 40px; width: 100%; max-width: 380px; box-shadow: 0 8px 40px rgba(15,42,34,.10); border: 1px solid var(--hp-border); }
.login-card-title { font-size: 22px; font-weight: 800; color: #14322a; }
.login-card-sub { font-size: 13px; color: #64748b; margin: 2px 0 22px; }
.login-card .hp-form-group { margin-bottom: 14px; }
.login-card .hp-input { width: 100%; box-sizing: border-box; }
.login-submit { width: 100%; margin-top: 8px; padding: 12px; font-size: 15px; font-weight: 700; }
.login-demo { margin-top: 18px; font-size: 12px; }
@media (max-width: 800px) {
    .login-brand-panel { display: none; }
}

/* ---------- Sidebar fixes ---------- */
.hp-sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.hp-sidebar .brand small { display: block; font-size: 11px; font-weight: 400; letter-spacing: .04em; color: rgba(255,255,255,.55); margin-top: 2px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.12); }
.side-user-name { font-size: 13px; font-weight: 600; }
.side-user-role { font-size: 11px; color: rgba(255,255,255,.55); text-transform: capitalize; }

/* ---------- Welcome band ---------- */
.welcome-band { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.welcome-band h1 { font-size: 26px; font-weight: 800; color: #14322a; letter-spacing: -.02em; margin: 0 0 4px; }
.welcome-band p { margin: 0; font-size: 14px; color: var(--hp-text-muted); }
.welcome-band .welcome-focus { font-size: 13px; font-weight: 600; color: #92400e; background: #fef3c7; border: 1px solid #c8860a; border-radius: 8px; padding: 8px 14px; max-width: 380px; }

/* ---------- Mini wizard (deal pipeline state) ---------- */
.mini-wz { display: flex; align-items: center; flex: 1; min-width: 140px; }
.mini-wz-node { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--hp-border); background: #fff; flex-shrink: 0; }
.mini-wz-node.done { background: var(--hp-success); border-color: var(--hp-success); }
.mini-wz-node.current { background: var(--hp-gold); border-color: var(--hp-gold); box-shadow: 0 0 0 3px rgba(200,134,10,.22); }
.mini-wz-node.terminal { background: #94a3b8; border-color: #94a3b8; }
.mini-wz-bar { height: 2px; flex: 1; min-width: 12px; background: var(--hp-border); }
.mini-wz-bar.done { background: var(--hp-success); }
.pipe-row { display: flex; align-items: center; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--hp-border); }
.pipe-row:last-child { border-bottom: none; }
.pipe-name { width: 210px; flex-shrink: 0; }
.pipe-name .hp-hint { display: block; font-size: 11px; }
.pipe-meta { width: 130px; flex-shrink: 0; text-align: right; }
@media (max-width: 900px) { .pipe-name { width: 150px; } .pipe-meta { display: none; } }

/* ---------- Home grid ---------- */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr; } }
.row-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hp-border); }
.row-item:last-child { border-bottom: none; }

/* ---------- Deals pipeline kanban (landing view) ---------- */
.hp-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.hp-page-head h1 { font-size: 24px; font-weight: 800; color: var(--hp-dark-green); letter-spacing: -.02em; margin: 0 0 2px; }
.hp-page-head .hp-hint { margin: 0; }
.hp-form-inline { display: flex; gap: 8px; align-items: center; }
.hp-input-sm { padding: 5px 10px; font-size: 12px; }

.pipe-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pipe-toolbar-left, .pipe-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pipe-toggle { display: inline-flex; background: #e8ede9; border-radius: 999px; padding: 3px; gap: 2px; }
.pipe-toggle-btn { padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--hp-text-muted); }
.pipe-toggle-btn:hover { color: var(--hp-dark-green); text-decoration: none; }
.pipe-toggle-btn.active { background: var(--hp-dark-green); color: #fff; }

.pipe-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.pipe-col { border-radius: 14px; padding: 12px; min-height: 140px; }
.pipe-tint-0 { background: #edf6f0; }
.pipe-tint-1 { background: #eef4fa; }
.pipe-tint-2 { background: #fbf6e9; }
.pipe-tint-3 { background: #fbf0ee; }
.pipe-tint-4 { background: #f4f0fa; }
.pipe-tint-5 { background: #ecf8f6; }
.pipe-tint-6 { background: #f2f6ec; }
.pipe-tint-7 { background: #f0f2f6; }
.pipe-col-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 2px 4px 12px; }
.pipe-col-name { font-size: 14px; font-weight: 700; color: var(--hp-dark-green); }
.pipe-col-count { font-size: 11px; color: var(--hp-text-muted); margin-top: 1px; }
.pipe-col-sum { font-size: 13px; font-weight: 700; color: var(--hp-dark-green); white-space: nowrap; }

.pipe-card { display: block; background: var(--hp-surface); border: 1px solid rgba(226,232,240,.9); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; text-decoration: none; color: inherit; box-shadow: var(--hp-shadow-sm); transition: box-shadow .15s, transform .15s; }
.pipe-card:hover { box-shadow: var(--hp-shadow); transform: translateY(-1px); text-decoration: none; }
.pipe-card:last-of-type { margin-bottom: 0; }
.pipe-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pipe-card-title { font-size: 14px; font-weight: 700; color: var(--hp-dark-green); line-height: 1.25; }
.pipe-card-sub { font-size: 12px; color: var(--hp-text-muted); margin-top: 2px; }
.pipe-badge { flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: .02em; border-radius: 999px; padding: 2px 9px; }
.pipe-badge-new { background: #e0e9fb; color: #1e40af; }
.pipe-badge-warn { background: #fdeecd; color: #92400e; }
.pipe-badge-danger { background: #fbdedd; color: #991b1b; }
.pipe-card-amt-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.pipe-card-amt { font-size: 17px; font-weight: 800; color: var(--hp-dark-green); letter-spacing: -.01em; }
.pipe-card-pct { font-size: 11px; color: var(--hp-text-muted); }
.pipe-bar { height: 4px; background: #e8ede9; border-radius: 3px; overflow: hidden; margin: 6px 0 10px; }
.pipe-bar span { display: block; height: 100%; background: var(--hp-dark-green); border-radius: 3px; }
.pipe-bar span.pipe-bar-warn { background: var(--hp-warning); }
.pipe-card-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--hp-text-muted); }
.pipe-avatar { width: 20px; height: 20px; border-radius: 50%; background: #fdf0dc; border: 1px solid #ecd9b8; color: #8a6410; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; }
.pipe-add { display: block; text-align: center; padding: 12px; border: 1.5px dashed #cbd5e1; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--hp-text-muted); }
.pipe-add:hover { border-color: var(--hp-dark-green); color: var(--hp-dark-green); text-decoration: none; }
.pipe-card[draggable="true"] { cursor: grab; }
.pipe-card.dragging { opacity: .45; cursor: grabbing; }
.pipe-col-over { outline: 2px dashed var(--hp-dark-green); outline-offset: -2px; }
.pipe-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); background: var(--hp-dark-green); color: #fff; font-size: 13px; font-weight: 600; padding: 10px 18px; border-radius: 10px; box-shadow: var(--hp-shadow-lg); opacity: 0; transition: opacity .2s, transform .2s; z-index: 80; }
.pipe-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 240px; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: #f1f5f9; border-radius: 10px; padding: 10px; min-height: 120px; }
.board-col-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #14322a; text-transform: uppercase; letter-spacing: .04em; padding: 4px 4px 10px; }
.board-stage-num { background: #14322a; color: #fff; border-radius: 6px; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.board-count { margin-left: auto; color: #64748b; }
.board-empty { color: #cbd5e1; text-align: center; padding: 14px 0; }
.deal-card { display: block; background: #fff; border: 1px solid var(--hp-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.deal-card:hover { box-shadow: 0 4px 14px rgba(20,50,42,.12); transform: translateY(-1px); }
.deal-card-breach { border-left: 3px solid var(--hp-warning); }
.deal-card-name { font-weight: 600; font-size: 14px; color: #14322a; }
.deal-card-meta { font-size: 12px; color: #64748b; margin: 3px 0 6px; }
.deal-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* ---------- Deal header ---------- */
.deal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.deal-title { font-size: 22px; font-weight: 700; color: #14322a; display: flex; align-items: center; gap: 10px; }
.deal-head-actions { display: flex; gap: 8px; }

/* ---------- Wizard stepper ---------- */
.wizard { display: flex; align-items: flex-start; background: #fff; border: 1px solid var(--hp-border); border-radius: 12px; padding: 20px 16px 14px; margin-bottom: 16px; }
.wz-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.wz-node { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: #e2e8f0; color: #64748b; z-index: 1; transition: all .2s; }
.wz-node svg { width: 16px; height: 16px; }
.wz-label { font-size: 12px; font-weight: 600; margin-top: 8px; color: #64748b; }
.wz-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; min-height: 14px; }
.wz-bar { position: absolute; top: 17px; left: calc(50% + 20px); width: calc(100% - 40px); height: 3px; background: #e2e8f0; border-radius: 2px; }
.wz-bar-done { background: var(--hp-light-green); }
.wz-done .wz-node { background: var(--hp-light-green); color: #14322a; }
.wz-done .wz-label { color: #14322a; }
.wz-current .wz-node { background: #14322a; color: #fff; box-shadow: 0 0 0 5px rgba(74,222,128,.25); }
.wz-current .wz-label { color: #14322a; font-weight: 700; }
.wz-current .wz-sub { color: #c8860a; font-weight: 600; }
.wz-idle .wz-node, .wz-todo .wz-node { background: #f1f5f9; }

/* ---------- Gate card / requirements ---------- */
.gate-card { border-left: 4px solid #c8860a; }
.req-list { margin-bottom: 12px; }
.req { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.req-icon { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.req-met { color: #166534; }
.req-met .req-icon { background: #dcfce7; }
.req-missing { color: #92400e; }
.req-missing .req-icon { background: #fef3c7; }

/* ---------- Workflow steps (wizard) ---------- */
.step-list { display: flex; flex-direction: column; }
.step { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--hp-border); }
.step:last-child { border-bottom: none; }
.step-node { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; background: #f1f5f9; color: #64748b; margin-top: 2px; }
.step-done .step-node { background: var(--hp-light-green); color: #14322a; }
.step-current .step-node { background: #14322a; color: #fff; box-shadow: 0 0 0 4px rgba(74,222,128,.25); }
.step-body { flex: 1; min-width: 0; }
.step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-label { font-weight: 600; font-size: 14px; color: #14322a; }
.step-todo .step-label { color: #94a3b8; }
.step-done-note { margin-top: 2px; }
.step-instructions { margin-top: 4px; }
.step-instructions summary { cursor: pointer; }
.instr { margin: 6px 0 0; padding-left: 20px; font-size: 13px; color: #475569; }
.instr li { margin-bottom: 3px; }
.agent-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #1a4a36; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 999px; padding: 1px 8px; }
.step-actions { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* ---------- Milestones ---------- */
.milestone-row { display: flex; gap: 14px; flex-wrap: wrap; }
.milestone { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--hp-border); border-radius: 10px; padding: 12px 14px; }
.milestone-done { border-color: var(--hp-light-green); background: #f0fdf4; }
.milestone-dot { width: 28px; height: 28px; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.milestone-done .milestone-dot { background: var(--hp-light-green); color: #14322a; }

/* ---------- Progress bars ---------- */
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin: 8px 0 14px; }
.progress-lg { height: 14px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #1a4a36, #4ade80); border-radius: 4px; transition: width .3s; }

/* ---------- Checklist ---------- */
.cl-category { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: 14px 0 4px; }

/* ---------- IM sections ---------- */
.im-section { border: 1px solid var(--hp-border); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.im-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.im-body summary { cursor: pointer; margin-top: 6px; }
.im-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }

/* ---------- Rating chip ---------- */
.rating-chip { display: flex; align-items: center; gap: 12px; }
.rating-grade { font-size: 26px; font-weight: 800; color: #14322a; background: linear-gradient(135deg, #fef3c7, #fde68a); border: 1px solid #c8860a; border-radius: 10px; padding: 6px 16px; }

/* ---------- Misc ---------- */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hp-select-sm { padding: 4px 8px; font-size: 12px; }
.row-accepted { background: #f0fdf4; }
.hp-stats-row { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.hp-stats-row .hp-stat { flex: 1; min-width: 150px; }

/* ---------- Command center ---------- */
.command-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.cmd-col { min-width: 0; }
.cmd-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: 6px; }
.cmd-item { font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--hp-border); }
.cmd-item:last-child { border-bottom: none; }
.cmd-sev-high .cmd-flag { color: var(--hp-danger); font-weight: 700; }
.cmd-next { font-size: 14px; font-weight: 600; color: #14322a; background: #fef3c7; border: 1px solid #c8860a; border-radius: 8px; padding: 8px 12px; }

/* ---------- DD workbench ---------- */
.dd-item { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--hp-border); }
.dd-item:last-of-type { border-bottom: none; }
.dd-main { flex: 1; min-width: 0; }
.dd-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dd-sev-high { border-left: 3px solid var(--hp-danger); padding-left: 10px; }
.dd-sev-medium { border-left: 3px solid var(--hp-warning); padding-left: 10px; }
.dd-sev-low { border-left: 3px solid var(--hp-border); padding-left: 10px; }
.dd-closed { opacity: .6; }
.dd-type { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 4px; padding: 2px 6px; margin-right: 6px; background: #eef2f7; color: #475569; }
.dd-type-red_flag { background: #fee2e2; color: #991b1b; }
.dd-type-question { background: #dbeafe; color: #1e40af; }
.dd-type-missing_document { background: #fef3c7; color: #92400e; }
.dd-type-discrepancy { background: #ede9fe; color: #5b21b6; }

/* ---------- IM citations ---------- */
.im-citations { margin: 8px 0; padding: 8px 10px; background: #f8fafc; border: 1px solid var(--hp-border); border-radius: 8px; }
.cite { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 0; font-size: 12px; }
.cite-unverified span:first-child { color: #92400e; }
.cite-unsupported span:first-child { color: #991b1b; }
.cite-verified span:first-child { color: #166534; }

/* ---------- Checklist match proposal ---------- */
.match-proposal { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.match-suggestion { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--hp-border); }
.match-suggestion:last-child { border-bottom: none; }

/* ---------- Tasks ---------- */
.task-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--hp-border); font-size: 13px; }
.task-row:last-child { border-bottom: none; }
.task-check { background: none; border: 1px solid var(--hp-border); border-radius: 50%; width: 20px; height: 20px; cursor: pointer; color: #64748b; font-size: 11px; line-height: 1; }
.task-check:hover { border-color: var(--hp-success); color: var(--hp-success); }

/* ---------- New-deal wizard ---------- */
.wz-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.review-grid { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.review-grid dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.review-grid dd { margin: 0; font-size: 14px; color: var(--hp-text); }
.hp-input-error { border-color: var(--hp-danger) !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12); }

/* ---------- Home: card rhythm, funnel, two-col ---------- */
.hp-content > .hp-card { margin-bottom: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.funnel { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--hp-border); }
.funnel-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.funnel-label { width: 92px; flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--hp-text-muted); }
.funnel-track { flex: 1; height: 20px; background: #f1f5f4; border-radius: 5px; overflow: hidden; }
.funnel-fill { height: 100%; min-width: 2px; border-radius: 5px; background: linear-gradient(90deg, #14322a, #4ade80); transition: width .4s ease; }
.funnel-val { width: 150px; flex-shrink: 0; text-align: right; font-size: 12px; color: var(--hp-text); }
.pipeline-rows { display: block; }

/* ---------- Impersonation ---------- */
.impersonate-badge { font-size: 12px; font-weight: 600; color: #92400e; background: #fef3c7; border: 1px solid #c8860a; border-radius: 6px; padding: 5px 10px; }

/* ---------- Clickable stat cards ---------- */
a.hp-stat { display: block; text-decoration: none; color: inherit; transition: var(--hp-transition); }
a.hp-stat:hover { border-color: var(--hp-light-green); box-shadow: var(--hp-shadow-md, 0 4px 12px rgba(0,0,0,.08)); text-decoration: none; }
.hp-stat-view { font-size: 11px; font-weight: 600; color: var(--hp-light-green); margin-top: 6px; }

/* ---------- Sidebar count badge ---------- */
.nav-badge { margin-left: auto; background: var(--hp-light-green); color: #06281f; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }


/* ---------- Deal page: current action card (matches gate card) ---------- */
.action-card { border-left: 4px solid var(--hp-light-green); }

/* ---------- Floating "Ask the system" chat ---------- */
.chat-fab { position: fixed; right: 24px; bottom: 24px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--hp-dark-green); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 60; transition: var(--hp-transition); }
.chat-fab:hover { transform: scale(1.06); }
.chat-panel { position: fixed; right: 24px; bottom: 88px; width: 340px; max-width: calc(100vw - 48px);
  background: var(--hp-surface); border: 1px solid var(--hp-border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.22); display: none; flex-direction: column; overflow: hidden; z-index: 60; }
.chat-panel.open { display: flex; }
.chat-head { padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--hp-dark-green);
  border-bottom: 1px solid var(--hp-border); background: #f8faf9; }
.chat-log { padding: 12px 14px; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { font-size: 13px; line-height: 1.4; padding: 8px 11px; border-radius: 10px; max-width: 88%; }
.chat-msg.sys { background: #f1f5f4; color: var(--hp-text); align-self: flex-start; border-bottom-left-radius: 3px; }
.chat-msg.me { background: var(--hp-dark-green); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hp-border); }
.chat-input .hp-input { flex: 1; }

/* ---------- Deal page: main + activity sidebar ---------- */
.deal-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.feed-sidebar { position: sticky; top: 16px; }
.feed-card .feed-body { max-height: 72vh; overflow-y: auto; }
.feed-post { margin-bottom: 10px; }
.feed-item { padding: 10px 0; border-bottom: 1px solid var(--hp-border); font-size: 13px; }
.feed-item:last-child { border-bottom: none; }
.feed-meta { display: flex; gap: 6px; align-items: baseline; }
.feed-time { margin-left: auto; font-size: 11px; color: var(--hp-muted, #6b7280); white-space: nowrap; }
.feed-text { margin: 4px 0 2px; line-height: 1.45; }
.feed-reply { margin: 6px 0 0 14px; padding: 6px 9px; background: var(--hp-bg); border-radius: 8px; font-size: 12px; line-height: 1.4; }
.feed-reply-form { margin-top: 6px; }
@media (max-width: 1100px) {
  .deal-layout { grid-template-columns: 1fr; }
  .feed-sidebar { position: static; }
}

/* ---------- Social feed ---------- */
.feed-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--hp-border); font-size: 13px; }
.feed-item:last-child { border-bottom: none; }
.feed-avatar { width: 34px; height: 34px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed-avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.feed-card-body { flex: 1; min-width: 0; }
.feed-actions { display: flex; gap: 14px; margin-top: 4px; }
.feed-action { background: none; border: none; padding: 0; font-size: 12px; font-weight: 600;
  color: var(--hp-dark-green); cursor: pointer; text-decoration: none; }
.feed-action:hover { text-decoration: underline; }
.feed-reply { display: flex; gap: 8px; margin-top: 8px; padding: 8px 10px; background: var(--hp-bg); border-radius: 8px; font-size: 12px; line-height: 1.4; }
.feed-reply-form { margin-top: 8px; }

/* ---------- TODO list (action points) ---------- */
.todo-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hp-border); }
.todo-item:last-child { border-bottom: none; }
.todo-check { width: 18px; height: 18px; margin-top: 2px; border: 2px solid var(--hp-border); border-radius: 5px;
  background: #fff; cursor: pointer; flex-shrink: 0; transition: var(--hp-transition); }
.todo-check:hover { border-color: var(--hp-dark-green); background: var(--hp-light-green); }
.todo-body { flex: 1; min-width: 0; }
.todo-text { font-size: 13px; font-weight: 600; color: inherit; text-decoration: none; }
.todo-text:hover { color: var(--hp-dark-green); }

/* ---------- Topbar right cluster ---------- */
.topbar-right { display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; }
.topbar-date { font-size: 13px; color: var(--hp-text-muted, #6b7a74); font-weight: 500; white-space: nowrap; }
.topbar-right form { margin: 0; }
.topbar-right .hp-select-sm { max-width: 170px; }

/* ---------- Mail client (3-pane) ---------- */
.mail-client { display: grid; grid-template-columns: 160px 300px 1fr; border: 1px solid var(--hp-border);
  border-radius: 12px; overflow: hidden; background: var(--hp-surface); min-height: 480px; }
.mail-folders { border-right: 1px solid var(--hp-border); background: var(--hp-bg); padding: 8px 0; }
.mail-folder { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px;
  font-size: 13px; font-weight: 600; color: inherit; text-decoration: none; }
.mail-folder:hover { background: var(--hp-light-green); }
.mail-folder.active { background: var(--hp-light-green); color: var(--hp-dark-green); }
.mail-count { font-size: 11px; font-weight: 700; background: var(--hp-dark-green); color: #fff;
  border-radius: 10px; padding: 1px 7px; }
.mail-list { border-right: 1px solid var(--hp-border); overflow-y: auto; max-height: 70vh; }
.mail-row { display: block; padding: 10px 14px; border-bottom: 1px solid var(--hp-border);
  color: inherit; text-decoration: none; }
.mail-row:hover { background: var(--hp-bg); }
.mail-row.active { background: var(--hp-light-green); border-left: 3px solid var(--hp-dark-green); padding-left: 11px; }
.mail-row-top { display: flex; justify-content: space-between; align-items: baseline; }
.mail-from { font-size: 13px; font-weight: 700; }
.mail-date { font-size: 11px; color: var(--hp-text-muted, #6b7a74); }
.mail-subject { font-size: 13px; font-weight: 600; margin-top: 1px; }
.mail-preview { font-size: 12px; color: var(--hp-text-muted, #6b7a74); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600;
  color: var(--hp-dark-green); background: var(--hp-light-green); border-radius: 4px; padding: 1px 6px; }
.mail-tag-pending { color: #8a978f; background: var(--hp-bg); }
.mail-reading { overflow-y: auto; max-height: 70vh; }
.mail-reading-head { padding: 16px 20px; border-bottom: 1px solid var(--hp-border); }
.mail-reading-subject { font-size: 16px; font-weight: 700; }
.mail-reading-meta { margin-top: 6px; font-size: 13px; }
.mail-suggestion { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 12px; padding: 10px 12px; background: var(--hp-bg); border: 1px solid var(--hp-border);
  border-radius: 8px; font-size: 13px; }
.mail-body { padding: 20px; font-size: 14px; line-height: 1.65; white-space: normal; }
.mail-empty { padding: 40px 20px; text-align: center; color: var(--hp-text-muted, #6b7a74); font-size: 13px; }
@media (max-width: 900px) { .mail-client { grid-template-columns: 120px 1fr; } .mail-reading { display: none; } }

/* ---------- Mail client polish ---------- */
.mail-row { display: flex; gap: 10px; align-items: flex-start; }
.mail-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
  background: var(--hp-dark-green); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.mail-row-main { flex: 1; min-width: 0; }
.mail-analyst { margin: 14px 20px 0; padding: 12px 14px; border: 1px solid var(--hp-border);
  border-left: 3px solid var(--hp-dark-green); border-radius: 8px; background: var(--hp-bg); }
.mail-analyst-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--hp-dark-green); }
.mail-analyst-summary { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: #3d4a45; }
.mail-analyst-items { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: #3d4a45; }

/* ---------- Collapsible connected-inboxes ---------- */
.mail-accounts summary { list-style: none; cursor: pointer; padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mail-accounts summary::-webkit-details-marker { display: none; }
.mail-accounts summary::after { content: '▸'; font-size: 12px; color: var(--hp-text-muted, #6b7a74); transition: transform .15s; }
.mail-accounts[open] summary::after { transform: rotate(90deg); }
.mail-accounts-line { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }

/* ---------- Connected-inboxes spacing ---------- */
.mail-accounts { margin-bottom: 16px; }
.mail-accounts summary { padding: 13px 18px; }
.mail-accounts summary:hover { background: var(--hp-bg); }
.mail-accounts summary::after { margin-left: auto; }
.mail-accounts-line { gap: 10px; }
.mail-accounts-line svg { color: var(--hp-dark-green); flex-shrink: 0; }
.mail-client { margin-top: 0; }

/* ---------- Mail client — reference redesign ---------- */
.mail-folders-title { font-size: 15px; font-weight: 700; padding: 10px 14px 12px; color: var(--hp-dark-green); }
.mail-folder { gap: 9px; padding: 9px 14px; border-radius: 8px; margin: 0 8px; }
.mail-folder svg { color: var(--hp-text-muted, #6b7a74); flex-shrink: 0; }
.mail-folder.active svg, .mail-folder:hover svg { color: var(--hp-dark-green); }
.mail-folder .mail-count { margin-left: auto; }
.mail-list-search { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--hp-border); position: sticky; top: 0; background: var(--hp-surface); z-index: 2; }
.mail-list-search svg { color: var(--hp-text-muted, #6b7a74); flex-shrink: 0; }
.mail-list-search input { border: none; outline: none; background: none; font-size: 13px; width: 100%; color: inherit; }
.mail-avatar-lg { width: 38px; height: 38px; font-size: 15px; margin-top: 0; }
.mail-reading-meta { display: flex; align-items: center; gap: 10px; }
.mail-chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px;
  padding: 3px 10px; border-radius: 20px; background: var(--hp-light-green); color: var(--hp-dark-green);
  margin-bottom: 8px; }
.mail-chip-filed { background: #eef2f0; color: #5a6b64; }

/* ---------- Dashboard — reference-clean ---------- */
.dash-overview { display: grid; grid-template-columns: 1.9fr 1fr; gap: 20px; margin-bottom: 20px; align-items: start; }
@media (max-width: 1000px) { .dash-overview { grid-template-columns: 1fr; } }
.hp-stat-sub { font-size: 12px; color: var(--hp-text-muted); margin-top: 6px; }
a.hp-stat:hover .hp-stat-sub { color: var(--hp-dark-green); }
.sect-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
/* funnel as a clean chart */
.funnel-row { padding: 7px 0; }
.funnel-track { height: 24px; background: #f1f5f4; border-radius: 6px; }
.funnel-fill { border-radius: 6px; }
.funnel-val { font-weight: 700; color: var(--hp-dark-green); width: 40px; }

/* ---------- Mail client — cleanup pass ---------- */
.hp-content-wide { max-width: 1600px; }
.mail-client { grid-template-columns: 170px 340px 1fr; }
.mail-folders-title { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--hp-text-muted, #6b7a74); padding: 16px 16px 8px; }
.mail-folder { padding: 9px 14px; }
.mail-row { padding: 13px 16px; gap: 12px; }
.mail-row-top { margin-bottom: 1px; }
.mail-preview { color: #8a978f; }
.mail-reading-head { padding: 22px 26px 18px; }
.mail-reading-subject { font-size: 17px; letter-spacing: -.01em; }
.mail-reading-meta { margin-top: 10px; }
.mail-body { padding: 26px; font-size: 14px; line-height: 1.72; color: #33413c; }
.mail-suggestion { padding: 14px 16px; border-radius: 10px; }
.mail-analyst { margin: 18px 26px 0; }
.mail-empty { padding: 64px 24px; }
.mail-empty svg { display: block; margin: 0 auto 12px; color: #c3cdc8; }

/* ---------- Approve card + evidence ---------- */
.mail-suggestion-block { display: block; }
.mail-approve-form { margin-top: 10px; }
.mail-task-check { display: flex; align-items: flex-start; gap: 7px; font-size: 13px;
  color: #3d4a45; margin: 4px 0; cursor: pointer; }
.mail-task-check input { margin-top: 3px; }
.feed-evidence { display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 12px; color: var(--hp-text-muted, #6b7a74); }
.feed-evidence svg { flex-shrink: 0; }

/* ---------- Ask — chat over the synced inbox ---------- */
.ask-wrap { max-width: 740px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 190px); }
.ask-hero { text-align: center; padding: 9vh 0 30px; }
.ask-hero h1 { font-size: 30px; font-weight: 800; color: var(--hp-dark-green); letter-spacing: -.02em; margin: 0 0 8px; }
.ask-log { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 6px 0 18px; }
.ask-msg { max-width: 86%; padding: 11px 15px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.ask-msg.user { align-self: flex-end; background: var(--hp-dark-green); color: #fff; border-bottom-right-radius: 4px; }
.ask-msg.ai { align-self: flex-start; background: var(--hp-surface); border: 1px solid var(--hp-border); border-bottom-left-radius: 4px; box-shadow: var(--hp-shadow-sm); }
.ask-sources { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ask-src { font-size: 12px; color: var(--hp-text-muted); border-left: 3px solid var(--hp-light-green); background: #f7faf8; border-radius: 0 8px 8px 0; padding: 5px 10px; }
.ask-src strong { color: var(--hp-dark-green); }
.ask-src-date { color: #a9b8b0; }
.ask-box { display: flex; gap: 10px; align-items: flex-end; background: var(--hp-surface); border: 1px solid var(--hp-border); border-radius: 16px; padding: 10px 10px 10px 16px; box-shadow: var(--hp-shadow-sm); }
.ask-box:focus-within { border-color: var(--hp-light-green); box-shadow: 0 0 0 3px rgba(74,222,128,.15); }
.ask-box textarea { flex: 1; border: none; resize: none; outline: none; font: inherit; font-size: 14px; line-height: 1.5; max-height: 140px; background: transparent; color: var(--hp-text); padding: 8px 0; }
.ask-send { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--hp-dark-green); color: #fff; border: none; font-size: 17px; cursor: pointer; transition: var(--hp-transition); }
.ask-send:hover { background: var(--hp-mid-green); }
.ask-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 14px 0 4px; }
.ask-chip { font-size: 12px; color: var(--hp-text-muted); background: var(--hp-surface); border: 1px solid var(--hp-border); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: var(--hp-transition); }
.ask-chip:hover { border-color: var(--hp-dark-green); color: var(--hp-dark-green); }
.ask-thinking { display: inline-flex; gap: 5px; padding: 4px 2px; }
.ask-thinking i { width: 7px; height: 7px; border-radius: 50%; background: #b6c2bb; animation: ask-bounce 1.2s ease-in-out infinite; }
.ask-thinking i:nth-child(2) { animation-delay: .15s; }
.ask-thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes ask-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Collapsible sidebar ---------- */
.sb-toggle { position: absolute; right: -13px; top: 78px; z-index: 110; width: 26px; height: 26px; border-radius: 50%; background: var(--hp-surface); border: 1px solid var(--hp-border); color: var(--hp-dark-green); font-size: 14px; line-height: 1; cursor: pointer; box-shadow: var(--hp-shadow-sm); transition: transform .2s; }
.sb-toggle:hover { background: var(--hp-dark-green); color: #fff; }
.hp-app.sb-collapsed .sb-toggle { transform: rotate(180deg); right: -13px; }
.hp-sidebar { transition: width .2s; overflow: visible; }
.hp-app.sb-collapsed .hp-sidebar { width: 68px; }
.hp-app.sb-collapsed .hp-main { margin-left: 68px; }
.hp-app.sb-collapsed .hp-sidebar .brand { font-size: 0; padding: 0 0 22px; text-align: center; }
.hp-app.sb-collapsed .hp-sidebar .brand span { font-size: 20px; }
.hp-app.sb-collapsed .hp-sidebar .brand small { display: none; }
.hp-app.sb-collapsed .hp-sidebar nav a { font-size: 0; justify-content: center; gap: 0; padding: 12px 0; }
.hp-app.sb-collapsed .hp-sidebar nav a svg { flex-shrink: 0; }
.hp-app.sb-collapsed .hp-sidebar .nav-group { display: none; }
.hp-app.sb-collapsed .hp-sidebar .nav-badge { display: none; }
.hp-app.sb-collapsed .hp-sidebar .side-user { justify-content: center; padding: 14px 0; }
.hp-app.sb-collapsed .hp-sidebar .side-user > div { display: none; }

/* ---------- Ask — chat history rail ---------- */
.ask-shell { display: flex; gap: 26px; max-width: 1080px; margin: 0 auto; }
.ask-history { width: 210px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; padding-top: 10vh; }
.ask-new { display: block; text-align: center; padding: 9px 12px; border-radius: 10px; background: var(--hp-dark-green); color: #fff; font-size: 13px; font-weight: 600; }
.ask-new:hover { background: var(--hp-mid-green); color: #fff; text-decoration: none; }
.ask-threads { display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow-y: auto; }
.ask-thread { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 9px; font-size: 13px; color: var(--hp-text); line-height: 1.35; }
.ask-thread span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-thread small { color: var(--hp-text-muted); font-size: 11px; margin-top: 2px; }
.ask-thread:hover { background: #eef4f0; text-decoration: none; }
.ask-thread.active { background: #e3efe8; font-weight: 600; }
.ask-wrap { flex: 1; min-width: 0; }

/* ---------- Topbar menu toggle ---------- */
.hp-topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hp-topbar-left h1 { margin: 0; }
.topbar-burger { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--hp-border); background: transparent; color: var(--hp-dark-green); font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.topbar-burger:hover { background: var(--hp-dark-green); color: #fff; }

/* ---------- Calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.cal-leg { font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.cal-card { overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week-head { background: var(--hp-dark-green); color: #a7f3d0; }
.cal-week-head div { padding: 8px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.cal-day { min-height: 100px; border-right: 1px solid var(--hp-border); border-bottom: 1px solid var(--hp-border); padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-day:nth-child(7n) { border-right: none; }
.cal-other { background: #f6f8f7; }
.cal-other .cal-dom { color: #c3cdc8; }
.cal-today { background: #eef9f0; outline: 2px solid var(--hp-light-green); outline-offset: -2px; }
.cal-dom { font-size: 12px; font-weight: 700; color: var(--hp-text-muted); }
.cal-ev { display: block; font-size: 11px; padding: 2px 6px; border-radius: 5px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.cal-ev:hover { filter: brightness(.94); }
.st-confirmed { background: #dcfce7; color: #14532d; }
.st-proposed { background: #fef9c3; color: #713f12; }
.st-cancelled { background: #f1f5f4; color: #7c8b85; text-decoration: line-through; }
.cal-row { display: flex; gap: 14px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--hp-border); scroll-margin-top: 80px; }
.cal-row:last-child { border-bottom: none; }
.cal-row-when { width: 110px; flex-shrink: 0; }
.cal-row-when .hp-hint { display: block; }
.cal-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; width: 78px; text-align: center; flex-shrink: 0; }
.cal-row-main { min-width: 0; }
.mail-tag-reply { color: #92400e; background: #fef3c7; }

/* ---------- Doc wizard groups ---------- */
.wiz-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--hp-dark-green); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--hp-border); }
.wiz-group:first-child { margin-top: 0; }
.wiz-field { margin-bottom: 14px; }
.wiz-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.wiz-input { width: 280px; max-width: 100%; }
.wiz-input[type="date"] { width: 180px; }
.hp-muted-row td { opacity: .6; }

/* ---------- Wizard steps ---------- */
.wiz { display: grid; grid-template-columns: 220px 1fr; overflow: hidden; }
.wiz-rail { border-right: 1px solid var(--hp-border); padding: 20px 16px; background: var(--hp-bg); }
.wiz-rail-title { font-size: 13px; font-weight: 700; color: var(--hp-dark-green); margin-bottom: 14px; }
.wiz-step { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; opacity: .55; }
.wiz-step.current { opacity: 1; }
.wiz-step.done { opacity: .8; }
.wiz-dot { width: 22px; height: 22px; border-radius: 999px; background: #e3ebe7; color: var(--hp-dark-green); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wiz-step.current .wiz-dot { background: var(--hp-dark-green); color: #fff; }
.wiz-step.done .wiz-dot { background: var(--hp-light-green); color: #fff; }
.wiz-step-name { font-size: 13px; font-weight: 600; }
.wiz-step-sub { font-size: 11px; color: var(--hp-text-muted); }
.wiz-progress { height: 5px; background: #e3ebe7; border-radius: 999px; margin-top: 16px; overflow: hidden; }
.wiz-progress-bar { height: 100%; background: var(--hp-light-green); width: 0; transition: width .25s ease; }
.wiz-body { padding: 22px 26px; }
.wiz-nav { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hp-border); }
.wiz-nav .hp-hint { margin: 0 auto; }
#wiz-generate { margin-left: auto; }
@media (max-width: 800px) { .wiz { grid-template-columns: 1fr; } .wiz-rail { border-right: none; border-bottom: 1px solid var(--hp-border); } }

/* ---------- Document A4 preview ---------- */
.doc-page-wrap { background: #e8edeb; border: 1px solid var(--hp-border); border-radius: 10px; padding: 28px 16px; }
.doc-a4 { background: #fff; width: 794px; max-width: 100%; margin: 0 auto; padding: 72px 78px; box-shadow: 0 3px 20px rgba(15,40,32,.18); font-family: Georgia, 'Times New Roman', serif; font-size: 11pt; line-height: 1.6; color: #1a1a1a; }
.doc-a4 h1, .doc-a4 h2, .doc-a4 h3 { color: #111; line-height: 1.3; }
.doc-a4 table { border-collapse: collapse; width: 100%; font-size: 9.5pt; margin: 12px 0; }
.doc-a4 td, .doc-a4 th { border: 1px solid #9aa5a0; padding: 4px 8px; text-align: left; }
.doc-a4 th { background: #f0f4f2; }
.doc-a4 p { margin: 0 0 10px; }

/* ---------- Wizard generating overlay ---------- */
#wiz-loading { position: fixed; inset: 0; background: rgba(20,50,42,.45); display: flex; align-items: center; justify-content: center; z-index: 60; backdrop-filter: blur(2px); }
.wiz-loading-card { background: #fff; border-radius: 14px; padding: 30px 36px; text-align: center; max-width: 340px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.wiz-loading-text { font-size: 15px; font-weight: 700; color: var(--hp-dark-green); margin: 12px 0 6px; }
.wiz-spinner { color: var(--hp-light-green); animation: wiz-spin .9s linear infinite; }
@keyframes wiz-spin { to { transform: rotate(360deg); } }
#wiz-loading[hidden] { display: none; }

/* ---------- Ask: edit & resend ---------- */
.ask-msg.user { position: relative; }
.ask-edit { position: absolute; top: 50%; transform: translateY(-50%); left: -30px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--hp-border); background: var(--hp-surface); color: var(--hp-text-muted); font-size: 11px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ask-msg.user:hover .ask-edit { opacity: 1; }
.ask-edit:hover { color: var(--hp-dark-green); border-color: var(--hp-light-green); }

/* ---------- Document review (Notion-style) ---------- */
.docview { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 22px; align-items: start; }
.doc-title-bar { margin-bottom: 14px; }
.doc-title { font-size: 30px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.doc-paper-wrap { background: #f2f5f4; border: 1px solid var(--hp-border); border-radius: 10px; padding: 26px 14px; }
.doc-page { background: #fff; width: 794px; max-width: 100%; margin: 0 auto; padding: 64px 72px; box-shadow: 0 3px 20px rgba(15,40,32,.16); border-radius: 2px; font-family: Georgia, 'Times New Roman', serif; font-size: 11pt; line-height: 1.6; color: #1a1a1a; min-height: 300px; }
.doc-page[contenteditable="true"] { outline: none; cursor: text; }
.doc-page[contenteditable="true"]:focus { box-shadow: 0 0 0 2px var(--hp-light-green), 0 3px 20px rgba(15,40,32,.16); }
.doc-page h1, .doc-page h2, .doc-page h3 { color: #111; line-height: 1.3; }
.doc-page table { border-collapse: collapse; width: 100%; font-size: 9.5pt; margin: 12px 0; }
.doc-page td, .doc-page th { border: 1px solid #9aa5a0; padding: 4px 8px; text-align: left; }
.doc-page th { background: #f0f4f2; }
.doc-page p { margin: 0 0 10px; }

.doc-toolbar { position: absolute; z-index: 50; transform: translateX(-50%); display: flex; gap: 2px; background: #fff; border: 1px solid var(--hp-border); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 4px; }
.doc-toolbar button { border: none; background: none; width: 28px; height: 26px; border-radius: 5px; font-size: 12px; cursor: pointer; color: var(--hp-text); }
.doc-toolbar button:hover { background: #eef2f0; }
.doc-toolbar-sep { width: 1px; background: var(--hp-border); margin: 3px 3px; }

.doc-props { display: flex; flex-direction: column; gap: 12px; }
.doc-prop { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.doc-prop-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--hp-text-muted); }
.doc-actions { display: flex; flex-direction: column; gap: 6px; }

.doc-activity { margin-top: 28px; max-width: 794px; margin-left: auto; margin-right: auto; }
.act-feed { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.act-row { display: flex; gap: 10px; }
.act-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--hp-dark-green); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act-meta { font-size: 12px; color: var(--hp-text-muted); }
.act-comment { background: var(--hp-surface); border: 1px solid var(--hp-border); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-top: 4px; }
.act-comment-box { display: flex; gap: 8px; }

@page { size: A4; margin: 16mm 18mm; }
@media print {
    /* Hide app chrome; let the doc paginate naturally */
    .hp-sidebar, .hp-topbar, .docview-side, .doc-pager, .doc-gap,
    .doc-toolbar, #docSaveBar, .doc-activity, .doc-title-bar .hp-hint a,
    .doc-paper-wrap > .doc-pager { display: none !important; }
    .hp-app, .hp-main, .hp-content, .docview, .docview-main, .doc-paper-wrap { display: block !important; width: auto !important; margin: 0 !important; padding: 0 !important; border: none !important; background: #fff !important; }
    .doc-page { width: auto; max-width: none; box-shadow: none; border-radius: 0; padding: 0; }
    .doc-page table { page-break-inside: auto; }
    .doc-page tr { page-break-inside: avoid; }
}
@media (max-width: 1000px) { .docview { grid-template-columns: 1fr; } }

/* ---------- Page gaps (visual A4 boundaries) ---------- */
.doc-paper-wrap { position: relative; }
.doc-gap { height: 120px; margin: 0 -72px; position: relative; user-select: none; background: #fff; }
.doc-gap::before { content: ''; position: absolute; top: 32px; bottom: 32px; left: 0; right: 0; background: #f2f5f4; border-top: 1px solid #dde3e0; border-bottom: 1px solid #dde3e0; box-shadow: inset 0 8px 8px -6px rgba(15,40,32,.12), inset 0 -8px 8px -6px rgba(15,40,32,.12); }
.doc-gap span { position: absolute; right: 84px; top: 50%; transform: translateY(-50%); background: #e4eae8; color: #7a8a85; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
@media print { .doc-gap { display: none; } }

/* ---------- Doc page navigator ---------- */
.doc-pager { position: sticky; top: 70px; float: right; z-index: 40; display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--hp-border); border-radius: 999px; box-shadow: var(--hp-shadow-sm); padding: 4px 8px; font-size: 12px; margin-bottom: -34px; }
.doc-pager button { border: none; background: none; width: 22px; height: 22px; border-radius: 50%; font-size: 14px; cursor: pointer; color: var(--hp-dark-green); }
.doc-pager button:hover { background: #eef2f0; }
.doc-pager input { width: 34px; border: none; text-align: right; font-size: 12px; font-weight: 700; color: var(--hp-dark-green); background: transparent; }
.doc-pager input:focus { outline: none; }
.doc-pager input::-webkit-outer-spin-button, .doc-pager input::-webkit-inner-spin-button { -webkit-appearance: none; }
@media print { .doc-pager { display: none; } }

/* ---------- Document library ---------- */
.doclib-new { position: relative; }
.doclib-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; border: 1px solid var(--hp-border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 10px; width: 280px; display: flex; flex-direction: column; gap: 6px; }
.doclib-menu-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--hp-text-muted); margin-bottom: 2px; }
.doclib-opt { display: block; width: 100%; text-align: left; border: 1px solid var(--hp-border); border-radius: 8px; padding: 9px 12px; background: #fff; cursor: pointer; }
.doclib-opt:hover { border-color: var(--hp-light-green); background: #f6fbf8; }
.doclib-opt b { display: block; font-size: 13px; color: var(--hp-text); }
.doclib-opt span { font-size: 11px; color: var(--hp-text-muted); }

.doclib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.doclib-card { display: block; background: #fff; border: 1px solid var(--hp-border); border-radius: 10px; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.doclib-card:hover { box-shadow: 0 8px 24px rgba(15,40,32,.14); transform: translateY(-2px); }
.doclib-thumb { position: relative; background: #f2f5f4; padding: 14px 14px 0; height: 190px; overflow: hidden; }
.doclib-page { background: #fff; border-radius: 3px 3px 0 0; box-shadow: 0 2px 8px rgba(0,0,0,.10); height: 100%; padding: 12px 14px; overflow: hidden; font-size: 7px; line-height: 1.5; color: #3a4441; }
.doclib-line { white-space: nowrap; overflow: hidden; }
.doclib-line-gap { height: 6px; }
.doclib-line-skel { height: 6px; background: #e6ebe9; border-radius: 3px; margin: 8px 0; }
.doclib-file { font-size: 20px; font-weight: 800; color: #b9c4c0; text-align: center; margin-top: 60px; letter-spacing: .1em; }
.doclib-cat { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 999px; color: #1f3a33; border: 1px solid rgba(0,0,0,.06); }
.doclib-meta { padding: 10px 12px; border-top: 1px solid var(--hp-border); }
.doclib-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doclib-sub { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--hp-text-muted); margin-top: 4px; }
.doclib-status { margin-left: auto; font-size: 10px; }
.doclib-status.ok { color: #15803d; }
.doclib-status.draft { color: #b45309; }

/* ---------- Doc library: deal picker ---------- */
.doclib-deals { max-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.doclib-deal { text-align: left; border: none; background: none; padding: 6px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--hp-text); }
.doclib-deal:hover { background: #f0f4f2; }
.doclib-deal.sel { background: var(--hp-dark-green); color: #fff; }
.doclib-opt:disabled { opacity: .5; cursor: not-allowed; }
.doclib-menu[hidden], .doclib-deal[hidden] { display: none; }
