/* 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; }

/* ---------- 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); }
