:root { color-scheme: light; --green:#146c57; --green-dark:#0c4c3d; --ink:#17221f; --muted:#6d7a76; --line:#dfe7e4; --paper:#f6f8f7; --danger:#a33a32; }
* { box-sizing:border-box; }
body { margin:0; font:14px/1.45 Inter, "Microsoft YaHei", system-ui, sans-serif; color:var(--ink); background:var(--paper); }
button, input, textarea, select { font:inherit; }
button { border:0; border-radius:8px; padding:9px 14px; background:var(--green); color:white; cursor:pointer; }
button:hover { background:var(--green-dark); }
button:disabled { opacity:.45; cursor:not-allowed; }
input, textarea, select { width:100%; border:1px solid var(--line); border-radius:8px; padding:9px 10px; background:white; color:var(--ink); }
textarea { resize:vertical; }
.hidden { display:none !important; }
.login-card { width:min(420px, calc(100% - 32px)); margin:12vh auto; padding:32px; background:white; border:1px solid var(--line); border-radius:18px; box-shadow:0 20px 60px #173d3020; }
.login-card h1 { margin:12px 0 4px; }
.login-card input { margin:14px 0 10px; }
.login-card button { width:100%; }
.brand-mark { width:46px; height:46px; border-radius:13px; display:grid; place-items:center; color:white; background:var(--green); font-size:24px; font-weight:700; }
.error { color:var(--danger); }
.app { height:100vh; display:flex; flex-direction:column; }
header { height:58px; display:flex; align-items:center; justify-content:space-between; padding:0 20px; background:#102e26; color:white; }
header strong { font-size:17px; }
#assetLine { margin-left:14px; color:#b7d2c9; font-size:12px; }
.status-row { display:flex; align-items:center; gap:12px; }
.badge { padding:4px 8px; border-radius:99px; background:#d6972b; font-size:12px; }
.workspace { min-height:0; flex:1; display:grid; grid-template-columns:290px minmax(420px, 1fr) 300px; }
.contacts-pane, .details-pane { background:white; padding:16px; overflow:auto; }
.contacts-pane { border-right:1px solid var(--line); }
.details-pane { border-left:1px solid var(--line); }
.pane-title, .chat-title { display:flex; justify-content:space-between; align-items:center; gap:12px; }
h2 { margin:0 0 12px; font-size:16px; }
.ghost, .secondary { color:var(--green); background:#e8f2ef; }
.contacts { margin-top:12px; }
.contact { width:100%; text-align:left; border-radius:9px; padding:11px; background:white; color:var(--ink); border-bottom:1px solid var(--line); }
.contact:hover, .contact.active { background:#eaf3f0; }
.contact-top { display:flex; justify-content:space-between; gap:8px; }
.contact small, .preview { color:var(--muted); }
.preview { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:4px; }
.chat-pane { min-width:0; background:#eef2f0; }
.empty { height:100%; display:grid; place-items:center; color:var(--muted); }
.conversation { height:100%; display:flex; flex-direction:column; }
.chat-title { padding:14px 18px; background:white; border-bottom:1px solid var(--line); }
.chat-title h2 { margin:0; }
.chat-title span { color:var(--muted); }
.contact-controls { display:flex; align-items:center; gap:12px; }
.contact-controls select { width:120px; }
.contact-controls label { white-space:nowrap; }
.contact-controls input { width:auto; }
.messages { flex:1; overflow:auto; padding:20px; display:flex; flex-direction:column; gap:9px; }
.message { max-width:min(75%, 680px); padding:10px 12px; border-radius:12px; background:white; box-shadow:0 1px 2px #00000010; white-space:pre-wrap; }
.message.outbound { align-self:flex-end; background:#d8f3e9; }
.message small { display:block; margin-top:5px; color:var(--muted); font-size:11px; }
.composer { background:white; border-top:1px solid var(--line); padding:12px 16px; }
.composer-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:8px; }
#composerStatus { min-height:18px; margin:5px 0 0; color:var(--muted); }
.details-pane label { display:block; margin:12px 0; color:var(--muted); }
.details-pane label input, .details-pane label textarea { margin-top:5px; color:var(--ink); }
.details-pane hr { border:0; border-top:1px solid var(--line); margin:24px 0; }
.details-pane > input, .details-pane > textarea { margin-bottom:9px; }
@media (max-width: 1000px) { .workspace { grid-template-columns:250px 1fr; } .details-pane { display:none; } }
@media (max-width: 700px) { .workspace { grid-template-columns:1fr; } .contacts-pane { display:none; } #assetLine { display:none; } }
