/* Page-specific layouts: inbox, kanban, AI chat, client portal, login, split views. */

/* ----- Inbox (3 panes) ----- */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr) 280px; height: calc(100vh - var(--header-h) - 112px); min-height: 520px; overflow: hidden; grid-template-rows: minmax(0, 1fr); }
.inbox > div { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.inbox > div:last-child { border-right: 0; }
.inbox.no-ctx { grid-template-columns: 340px minmax(0, 1fr); }
.conv-list { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #eef2f6; cursor: pointer; position: relative; }
.conv:hover { background: #f8fbfd; }
.conv.on { background: linear-gradient(90deg, #eef9f3, #f2f8fd); }
.conv.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--green-500); }
.conv .meta { display: flex; justify-content: space-between; gap: 8px; }
.conv .name { font-weight: 600; }
.conv .last { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .unread { background: var(--green-500); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; padding: 0 5px; }
.ch-ico { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; }
.ch-ico.wa { background: #dff5e8; color: #0f8a4b; } .ch-ico.em { background: var(--blue-100); color: var(--blue-600); }
.thread { overflow-y: auto; flex: 1; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, #f6fafd, #f3f8fb); }
.bubble { max-width: 74%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; box-shadow: var(--shadow-xs); }
.bubble.in { background: #fff; border: 1px solid var(--border); border-top-left-radius: 4px; align-self: flex-start; }
.bubble.out { background: #dff3e8; border: 1px solid #c8e8d6; border-top-right-radius: 4px; align-self: flex-end; }
.bubble.out.auto { background: #e4eefb; border-color: #cfe0f6; }
.bubble .by { font-size: 10.5px; font-weight: 650; color: var(--text-3); margin-bottom: 2px; display: flex; gap: 5px; align-items: center; }
.bubble .at { font-size: 10.5px; color: var(--text-3); text-align: right; margin-top: 3px; }
.composer { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; gap: 8px; align-items: center; background: #fff; }
.composer .input { border-radius: 99px; }
.ctx-sec { padding: 14px; border-bottom: 1px solid var(--border); }
.ctx-sec h4 { margin: 0 0 8px; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

/* ----- Kanban ----- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.k-col { background: #eef3f8; border-radius: 14px; padding: 10px; }
.k-col h3 { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-size: 12.5px; }
.k-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--shadow-xs); cursor: pointer; }
.k-card:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); }
.k-card .t { font-weight: 600; font-size: 13px; line-height: 1.3; }
.k-card .f { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }

/* ----- Detail layouts ----- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.hero-card { display: flex; gap: 16px; align-items: center; padding: 16px; flex-wrap: wrap; }
.ent-switch { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; }
.ent { min-width: 188px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; }
.ent:hover { border-color: var(--green-400); }
.ent.on { border-color: var(--green-500); background: linear-gradient(135deg, #eef9f3, #f2f8fd); box-shadow: var(--ring); }
.ent .n { font-weight: 600; font-size: 13px; } .ent .s { font-size: 11.5px; color: var(--text-3); }
.reg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: #e2eaf2; }
.tl-ev { position: relative; padding: 0 0 16px; }
.tl-ev::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2.5px solid var(--green-500); }
.tl-ev.blue::before { border-color: var(--blue-600); } .tl-ev.red::before { border-color: var(--red-600); } .tl-ev.amber::before { border-color: var(--amber-600); }
.drop { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 26px 16px; text-align: center; background: #f9fbfd; }
.drop:hover { border-color: var(--green-400); background: var(--green-50); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.file-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-700); flex: none; }
.rule-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid #eef2f6; }
.rule-card:last-child { border-bottom: 0; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.flow .node { font-size: 11.5px; padding: 3px 9px; border-radius: 8px; font-weight: 600; background: var(--navy-50); color: var(--navy-700); }
.flow .node.act { background: var(--green-50); color: var(--green-700); }
.flow .arr { color: var(--text-3); }
.stat-big { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }

/* ----- AI chat ----- */
.ai-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.ai-chat { display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - 150px); min-height: 480px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ai-q { align-self: flex-end; background: var(--navy-800); color: #fff; padding: 9px 14px; border-radius: 14px 14px 4px 14px; max-width: 70%; }
.ai-a { align-self: flex-start; max-width: 88%; background: #fff; border: 1px solid var(--border); padding: 12px 14px; border-radius: 14px 14px 14px 4px; box-shadow: var(--shadow-xs); }
.ai-a .who { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 650; color: var(--green-700); margin-bottom: 6px; }
.sugg { padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; text-align: left; font-size: 12.5px; width: 100%; margin-bottom: 8px; }
.sugg:hover { border-color: var(--green-400); background: var(--green-50); }

/* ----- Auth pages ----- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); background: #fff; }
.auth-l { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: 100%; max-width: 390px; }
.auth-r { background: radial-gradient(circle at 20% 15%, rgba(61, 167, 127, 0.35), transparent 45%), radial-gradient(circle at 85% 80%, rgba(47, 125, 225, 0.35), transparent 50%), linear-gradient(160deg, var(--navy-900), var(--navy-800) 55%, var(--green-700)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-r h2 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; max-width: 440px; }
.auth-r .pt { display: flex; gap: 12px; align-items: flex-start; max-width: 440px; }
.auth-r .pt .ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.12); display: grid; place-items: center; flex: none; }
.auth-r .pt p { color: rgba(255, 255, 255, 0.78); font-size: 13px; margin-top: 2px; }
.glass { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 16px; padding: 16px; max-width: 440px; }

/* ----- Client upload portal (no login, mobile first) ----- */
body.portal { background: linear-gradient(180deg, #e7f1f9, #f5f9fc 300px); min-height: 100vh; }
.p-wrap { max-width: 480px; margin: 0 auto; padding: 18px 14px 40px; }
.p-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.p-top img { height: 30px; }
.p-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; background: #fff; }
.doc-item.done { background: var(--green-50); border-color: var(--green-200); }
.doc-item .ck { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef3f8; color: var(--text-3); flex: none; }
.doc-item.done .ck { background: var(--green-500); color: #fff; }
.doc-item.rej { background: var(--red-50); border-color: var(--red-100); }
.doc-item.rej .ck { background: var(--red-600); color: #fff; }

@media (max-width: 1200px) { .inbox { grid-template-columns: 290px minmax(0, 1fr); } .inbox:not(.no-ctx) > div:last-child { display: none; } .split, .ai-wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 800px) { .inbox { grid-template-columns: minmax(0, 1fr); height: auto; } .inbox > div:nth-child(2) { display: none; } .auth { grid-template-columns: minmax(0, 1fr); } .auth-r { display: none; } }

/* Getting started checklist */
.ob-card { margin-bottom: 18px; border: 1px solid #cfe8dc; background: linear-gradient(180deg, #f3fbf7, #fff); }
.ob-card .card-h h2 { display: flex; align-items: center; gap: 8px; }
.ob-prog { display: flex; align-items: center; gap: 10px; min-width: 150px; } .ob-prog .progress { flex: 1; height: 8px; } .ob-prog b { font-size: 13px; white-space: nowrap; }
.ob-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ob-step { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border, #e3e8ef); border-radius: 12px; background: #fff; color: inherit; text-decoration: none; transition: .15s; }
.ob-step:hover { border-color: #3da77f; box-shadow: 0 6px 16px rgba(20, 108, 87, .08); }
.ob-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eef2f7; color: #5b6b80; }
.ob-t { min-width: 0; } .ob-t b { display: block; font-size: 13px; line-height: 1.3; } .ob-t span { display: block; font-size: 11.5px; color: #6b7a8d; margin-top: 2px; }
.ob-step.done .ob-ic { background: #1f8a6c; color: #fff; } .ob-step.done .ob-t b { color: #5b6b80; text-decoration: line-through; text-decoration-color: #b8c4d2; }
.ob-step.next { border-color: #1f8a6c; box-shadow: 0 0 0 3px rgba(31, 138, 108, .12); } .ob-step.next .ob-ic { background: #d4efe2; color: #146c57; }
.ob-step em { position: absolute; right: 10px; top: 10px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #1f8a6c; padding: 2px 9px; border-radius: 99px; }
@media (max-width: 1100px) { .ob-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (max-width: 560px) { .ob-grid { grid-template-columns: 1fr; } .ob-prog { display: none; } }
.ob-step.next .ob-t { padding-right: 44px; }
