/* SalesDesk workspace styles -- portal house style, SalesDesk navy palette (P0 shell kept). */
:root { --navy: #0b1f3a; --navy2: #16345c; --bg: #f4f5f7; --border: #d9dde3; --text: #1c2733; --muted: #6b7683; --err: #b42318; --ok: #16a34a; }
* { box-sizing: border-box; margin: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
header { background: var(--navy); color: #fff; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
header h1 { font-size: 18px; font-weight: 600; letter-spacing: 0.4px; }
header .who { font-size: 13px; color: #c6cedb; display: flex; align-items: center; gap: 12px; }
header button { background: transparent; border: 1px solid #3b5273; color: #c6cedb; padding: 5px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; }
header button:hover { background: var(--navy2); color: #fff; }
.hidden { display: none !important; }
.dim { color: var(--muted); font-size: 13px; }
.pad { padding: 14px; }

/* Login (P0) */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 4px 18px rgba(11,31,58,0.08); }
.card h1 { font-size: 20px; color: var(--navy); margin-bottom: 4px; }
.card p.sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.card input { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.card input:focus { outline: 2px solid var(--navy); outline-offset: -1px; }
.btn { width: 100%; margin-top: 20px; background: var(--navy); color: #fff; border: 0; border-radius: 6px; padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--navy2); }
.btn:disabled { opacity: 0.6; cursor: default; }
.error { color: var(--err); font-size: 13px; margin-top: 12px; min-height: 17px; }

/* Workspace frame */
.workspace { display: flex; flex-direction: column; height: calc(100vh - 49px); }
.toolbar { padding: 10px 16px 8px; border-bottom: 1px solid var(--border); background: #fff; }
.buckets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.bucket-chip { border: 1px solid var(--border); background: #fff; border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); }
.bucket-chip.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; background: #fff; }
.filters input { min-width: 170px; flex: 1; max-width: 260px; }
.spacer { flex: 1; }
.btn-sm { background: var(--navy); color: #fff; border: 0; border-radius: 6px; padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-sm:hover { background: var(--navy2); }
.btn-sm.ghost { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-sm:disabled { opacity: 0.6; cursor: default; }
.bulkbar { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.bulkbar select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }

/* Two panes */
.panes { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(400px, 1.2fr); gap: 0; flex: 1; min-height: 0; }
.pane-list { overflow-y: auto; min-height: 0; border-right: 1px solid var(--border); background: #fff; }
.pane-detail { overflow-y: auto; min-height: 0; padding: 20px 24px 32px; background: #fafbfc; }
.pane-detail > * { max-width: 780px; }

/* Queue rows */
.qrow { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #eef0f3; cursor: pointer; align-items: flex-start; }
.qrow:hover { background: #f6f8fb; }
.qrow.sel { background: #eef3fa; }
.qrow input[type=checkbox] { margin-top: 3px; }
.qmain { flex: 1; min-width: 0; }
.qname { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qsub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.qtag { font-size: 10px; font-weight: 700; white-space: nowrap; }

/* Detail */
.d-name { font-weight: 700; font-size: 19px; letter-spacing: -0.2px; }
.d-sub { font-size: 12.5px; color: var(--muted); margin: 3px 0 12px; }
.box { background: #fff; border: 1px solid #e7eaee; border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.55; }
.box > div { margin-bottom: 2px; }
.box .lbl { display: block; font-size: 11px; color: var(--muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.box input, .box textarea, .box select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; }
.sec-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin: 20px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; row-gap: 6px; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 20px; padding: 4px 11px; font-size: 11.5px; font-weight: 600; line-height: 1.4; text-decoration: none; display: inline-block; }
.stage-chip { cursor: pointer; }
.cf-chip { color: var(--navy); background: #eef3fa; border-color: #d3e0f0; }
.row { display: flex; gap: 6px; align-items: center; }
.row > * { flex: 1; }
.row .btn-sm { flex: 0 0 auto; }
.script-block { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.script-block h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: #92400e; margin-bottom: 8px; }
.draft-block { background: #eff6ff; border-color: #bfdbfe; }
.draft-block h4 { color: #1e40af; }

/* Timeline */
.tl-item { border-left: 2px solid var(--border); padding: 2px 0 14px 14px; margin-left: 4px; font-size: 13px; line-height: 1.5; position: relative; }
.tl-item:before { content: ''; position: absolute; left: -5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.tl-kind { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; padding: 1px 6px; border-radius: 4px; background: #eef0f3; color: var(--muted); margin-right: 6px; }
.tl-when { font-size: 11px; color: var(--muted); }
.tl-body { color: #3a4653; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.back-btn { display: none; margin-bottom: 10px; }

/* New-lead form */
.nl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nl-grid .full { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .panes { grid-template-columns: 1fr; }
  .pane-detail { display: none; }
  .panes.show-detail .pane-list { display: none; }
  .panes.show-detail .pane-detail { display: block; }
  .back-btn { display: inline-block; }
  .filters input { min-width: 110px; }
}
