/* ChangeFluent Client Setup - admin styles
   Tokens are CSS custom properties so CF Operations brand() can override them. */
.cfcs {
	--cfcs-ink: #1c1917;
	--cfcs-sub: #78716c;
	--cfcs-faint: #a8a29e;
	--cfcs-bg: #fafaf9;
	--cfcs-panel: #ffffff;
	--cfcs-line: #e7e5e4;
	--cfcs-line-soft: #f0efec;
	--cfcs-ember: #ea580c;
	--cfcs-ember-deep: #c2410c;
	--cfcs-ember-soft: #fff1e8;
	--cfcs-ember-line: #fed7aa;
	--cfcs-done: #15803d;
	color: var(--cfcs-ink);
	font-size: 14px;
}
.cfcs .cfcs-h1 { font-size: 24px; font-weight: 700; margin: 6px 0 18px; }
.cfcs .cfcs-back a { text-decoration: none; color: var(--cfcs-sub); font-size: 13px; }
.cfcs .cfcs-hint { color: var(--cfcs-faint); font-size: 12px; line-height: 1.5; margin: 8px 0 0; }

.cfcs .cfcs-grid { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .cfcs .cfcs-grid { grid-template-columns: 1fr; } }

.cfcs .cfcs-card {
	background: var(--cfcs-panel); border: 1px solid var(--cfcs-line);
	border-radius: 12px; padding: 18px; margin-bottom: 16px;
}
.cfcs .cfcs-card h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }

.cfcs .cfcs-label { display: block; font-size: 12px; font-weight: 600; color: var(--cfcs-sub); margin: 14px 0 6px; }
.cfcs .cfcs-input {
	width: 100%; box-sizing: border-box; font-size: 14px; padding: 9px 11px;
	border: 1px solid var(--cfcs-line); border-radius: 9px; background: var(--cfcs-bg);
}
.cfcs textarea.cfcs-input { resize: vertical; }

.cfcs .cfcs-btn {
	display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
	padding: 9px 15px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
	margin-top: 14px;
}
.cfcs .cfcs-btn-primary { background: var(--cfcs-ember); color: #fff; }
.cfcs .cfcs-btn-primary:hover { background: var(--cfcs-ember-deep); color: #fff; }
.cfcs .cfcs-btn-ghost { background: var(--cfcs-panel); color: var(--cfcs-ink); border-color: var(--cfcs-line); }
.cfcs .cfcs-link { background: none; border: none; color: var(--cfcs-sub); cursor: pointer; font-size: 13px; }
.cfcs .cfcs-link-danger { background: none; border: none; color: #b91c1c; cursor: pointer; font-size: 12px; }

.cfcs .cfcs-table { width: 100%; border-collapse: collapse; }
.cfcs .cfcs-table th { text-align: left; font-size: 11px; color: var(--cfcs-faint); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; }
.cfcs .cfcs-table td { padding: 10px 8px; border-top: 1px solid var(--cfcs-line-soft); vertical-align: middle; }
.cfcs .cfcs-table a { text-decoration: none; }

.cfcs .cfcs-bar { display: inline-block; width: 90px; height: 6px; background: var(--cfcs-line-soft); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.cfcs .cfcs-bar.wide { width: 160px; }
.cfcs .cfcs-bar span { display: block; height: 100%; background: var(--cfcs-ember); transition: width .3s; }
.cfcs .cfcs-pct { font-size: 12px; color: var(--cfcs-sub); margin-left: 8px; }

.cfcs .cfcs-detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cfcs .cfcs-trade { color: var(--cfcs-sub); font-size: 13px; margin-top: 2px; }
.cfcs .cfcs-overall { display: flex; align-items: center; gap: 6px; }

.cfcs .cfcs-summary {
	background: var(--cfcs-ember-soft); border: 1px solid var(--cfcs-ember-line);
	border-radius: 11px; padding: 13px 15px; margin: 18px 0; font-size: 13px; line-height: 1.55;
}
.cfcs .cfcs-summary-tag {
	display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
	color: var(--cfcs-ember-deep); font-weight: 700; margin-bottom: 5px;
}

.cfcs .cfcs-phase { background: var(--cfcs-panel); border: 1px solid var(--cfcs-line); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.cfcs .cfcs-phase-head { display: flex; align-items: center; gap: 11px; }
.cfcs .cfcs-phase-no { font-family: ui-monospace, monospace; font-size: 12px; font-weight: 700; color: var(--cfcs-faint); }
.cfcs .cfcs-phase-head h2 { font-size: 17px; font-weight: 700; margin: 0; flex: 1; }
.cfcs .cfcs-phase-count { font-family: ui-monospace, monospace; font-size: 12px; color: var(--cfcs-sub); }
.cfcs .cfcs-why { color: var(--cfcs-sub); font-size: 13px; line-height: 1.5; border-left: 3px solid var(--cfcs-ember-line); padding-left: 12px; margin: 10px 0 14px; }

.cfcs .cfcs-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--cfcs-line-soft); }
.cfcs .cfcs-check {
	margin-top: 1px; width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px;
	border: 1.6px solid var(--cfcs-line); background: var(--cfcs-panel); cursor: pointer; padding: 0;
	position: relative;
}
.cfcs .cfcs-item.status-done .cfcs-check { background: var(--cfcs-done); border-color: var(--cfcs-done); }
.cfcs .cfcs-item.status-done .cfcs-check::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.cfcs .cfcs-item.status-na .cfcs-check { background: var(--cfcs-line-soft); border-color: var(--cfcs-line); }
.cfcs .cfcs-item-body { flex: 1; min-width: 0; }
.cfcs .cfcs-item-meta { display: flex; align-items: center; gap: 8px; }
.cfcs .cfcs-owner { font-family: ui-monospace, monospace; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; }
.cfcs .cfcs-tailored { font-family: ui-monospace, monospace; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: var(--cfcs-ember-deep); }
.cfcs .cfcs-item-label { font-size: 14px; line-height: 1.45; margin-top: 5px; }
.cfcs .cfcs-item.status-na .cfcs-item-label { text-decoration: line-through; color: var(--cfcs-faint); }
.cfcs .cfcs-item-note { font-size: 12px; color: var(--cfcs-faint); margin-top: 3px; }
.cfcs .cfcs-na-reason { display: none; margin-top: 8px; width: 100%; max-width: 360px; box-sizing: border-box; font-size: 12px; padding: 6px 9px; border-radius: 7px; border: 1px solid var(--cfcs-line); background: var(--cfcs-bg); }
.cfcs .cfcs-item.status-na .cfcs-na-reason { display: block; }
.cfcs .cfcs-na-btn { flex-shrink: 0; font-family: ui-monospace, monospace; font-size: 10px; font-weight: 700; color: var(--cfcs-faint); background: none; border: 1px solid var(--cfcs-line); padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.cfcs .cfcs-item.status-na .cfcs-na-btn { color: var(--cfcs-ember-deep); border-color: var(--cfcs-ember-line); }

.cfcs .cfcs-modal { position: fixed; inset: 0; background: rgba(28,25,23,.45); z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cfcs .cfcs-modal[hidden] { display: none; }
.cfcs .cfcs-modal-box { background: var(--cfcs-panel); border-radius: 14px; width: 100%; max-width: 620px; display: flex; flex-direction: column; overflow: hidden; }
.cfcs .cfcs-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--cfcs-line); }
.cfcs #cfcs-export-text { min-height: 320px; font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.55; padding: 14px; border: none; resize: none; background: var(--cfcs-bg); outline: none; }
.cfcs .cfcs-modal-foot { padding: 12px 16px; border-top: 1px solid var(--cfcs-line); text-align: right; }
.cfcs .cfcs-new form { margin: 0; }

/* Front end container and read only mode */
.cfcs-front { max-width: 1000px; margin: 0 auto; padding: 8px 0 40px; }
.cfcs-front .cfcs-h1 { font-size: 26px; }
.cfcs-readonly .cfcs-check,
.cfcs-readonly .cfcs-na-btn { pointer-events: none; opacity: .55; }
.cfcs-readonly .cfcs-na-reason { display: none; }
.cfcs-readonly .cfcs-item.status-na .cfcs-na-reason { display: block; }

/* Sources and analysis */
.cfcs .cfcs-sources { background: var(--cfcs-panel); border: 1px solid var(--cfcs-line); border-radius: 12px; padding: 18px 20px; margin: 18px 0; }
.cfcs .cfcs-sources-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.cfcs .cfcs-source-form { border: 1px dashed var(--cfcs-line); border-radius: 10px; padding: 14px; margin: 12px 0 16px; background: var(--cfcs-bg); }
.cfcs .cfcs-source-form textarea { margin-top: 10px; }
.cfcs .cfcs-source-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.cfcs .cfcs-source-row .cfcs-input { flex: 1; min-width: 160px; }
.cfcs .cfcs-source-row .cfcs-btn { margin-top: 0; }

.cfcs .cfcs-source { border-top: 1px solid var(--cfcs-line-soft); padding: 14px 0; }
.cfcs .cfcs-source-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cfcs .cfcs-source-type { display: inline-block; font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .04em; color: var(--cfcs-ember-deep); background: var(--cfcs-ember-soft); padding: 2px 7px; border-radius: 5px; margin-right: 8px; }
.cfcs .cfcs-source-head form { margin: 0; }
.cfcs .cfcs-source-summary { font-size: 13.5px; line-height: 1.55; margin: 10px 0 0; }
.cfcs .cfcs-mini-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--cfcs-faint); font-weight: 700; margin: 14px 0 6px; }
.cfcs .cfcs-brief, .cfcs .cfcs-handover { font-size: 13px; line-height: 1.55; color: var(--cfcs-sub); background: var(--cfcs-bg); border-radius: 9px; padding: 10px 12px; }

.cfcs .cfcs-suggestion { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; border: 1px solid var(--cfcs-line); border-radius: 9px; padding: 11px 13px; margin-bottom: 8px; }
.cfcs .cfcs-suggestion.decision-dismissed { opacity: .5; }
.cfcs .cfcs-suggestion.decision-accepted { border-color: var(--cfcs-done); background: #f0fdf4; }
.cfcs .cfcs-suggestion-body { flex: 1; min-width: 0; }
.cfcs .cfcs-suggestion-top { display: flex; align-items: center; gap: 10px; }
.cfcs .cfcs-sug-status { font-size: 11px; font-weight: 700; color: var(--cfcs-ink); background: var(--cfcs-line-soft); padding: 2px 8px; border-radius: 5px; }
.cfcs .cfcs-sug-conf { font-size: 11px; color: var(--cfcs-faint); }
.cfcs .cfcs-sug-item { font-size: 13.5px; margin-top: 6px; }
.cfcs .cfcs-sug-evidence { font-size: 12px; color: var(--cfcs-sub); margin-top: 4px; font-style: italic; }
.cfcs .cfcs-suggestion-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.cfcs .cfcs-btn.cfcs-sm { margin-top: 0; padding: 5px 11px; font-size: 12px; }
.cfcs .cfcs-decided { font-size: 12px; font-weight: 600; }
.cfcs .cfcs-decided.accepted { color: var(--cfcs-done); }
.cfcs .cfcs-decided.dismissed { color: var(--cfcs-faint); }
.cfcs .cfcs-questions ul { margin: 6px 0 0; padding-left: 18px; }
.cfcs .cfcs-questions li { font-size: 13px; color: var(--cfcs-sub); margin-bottom: 4px; }

.cfcs .cfcs-roles { border-collapse: collapse; margin: 6px 0 4px; }
.cfcs .cfcs-roles th { text-align: left; font-size: 11px; color: var(--cfcs-faint); text-transform: uppercase; letter-spacing: .05em; padding: 4px 16px 4px 0; }
.cfcs .cfcs-roles td { padding: 6px 16px 6px 0; font-size: 13px; border-top: 1px solid var(--cfcs-line-soft); }
.cfcs .cfcs-roles th:not(:first-child), .cfcs .cfcs-roles td:not(:first-child) { text-align: center; }

/* Client access panel (manager side) */
.cfcs .cfcs-client-access { background: var(--cfcs-panel); border: 1px solid var(--cfcs-ember-line); border-radius: 12px; padding: 16px 20px; margin: 18px 0; }
.cfcs .cfcs-ca-head { display: flex; align-items: center; gap: 10px; }
.cfcs .cfcs-ca-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.cfcs .cfcs-ca-on { font-size: 11px; font-weight: 700; color: var(--cfcs-done); background: #f0fdf4; padding: 2px 8px; border-radius: 5px; }
.cfcs .cfcs-ca-actions { display: flex; gap: 16px; margin: 12px 0 0; }
.cfcs #cfcs-client-link { font-family: ui-monospace, monospace; font-size: 12px; }

/* Client portal (client side) */
.cfcs-client { max-width: 760px; margin: 0 auto; padding: 8px 0 48px; }
.cfcs-client .cfcs-client-head { margin-bottom: 18px; }
.cfcs-client .cfcs-h1 { font-size: 28px; }
.cfcs-client .cfcs-client-intro { color: var(--cfcs-sub); font-size: 15px; line-height: 1.6; max-width: 560px; }
.cfcs-client .cfcs-card h2 { font-size: 17px; }
.cfcs-client .cfcs-client-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--cfcs-sub); margin-bottom: 14px; flex-wrap: wrap; }
.cfcs-client .cfcs-client-items { display: flex; flex-direction: column; gap: 2px; }
.cfcs-client .cfcs-client-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 8px; border-radius: 9px; cursor: pointer; font-size: 14.5px; line-height: 1.45; }
.cfcs-client .cfcs-client-item:hover { background: var(--cfcs-bg); }
.cfcs-client .cfcs-client-item.is-done span { color: var(--cfcs-faint); text-decoration: line-through; }
.cfcs-client .cfcs-client-check { margin-top: 2px; width: 19px; height: 19px; flex-shrink: 0; accent-color: var(--cfcs-ember); cursor: pointer; }
.cfcs-client .cfcs-client-upload textarea, .cfcs-client .cfcs-client-upload input[type="text"] { margin-bottom: 10px; }
.cfcs-client .cfcs-client-msg { font-size: 13px; margin: 10px 0 0; min-height: 18px; }
.cfcs-client .cfcs-client-msg.is-ok { color: var(--cfcs-done); }
.cfcs-client .cfcs-client-msg.is-err { color: #b91c1c; }
.cfcs-client .cfcs-label { margin-top: 12px; }

/* ===== Toolbar and filters ===== */
.cfcs .cfcs-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 16px; flex-wrap: wrap; }
.cfcs .cfcs-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cfcs .cfcs-chip { background: var(--cfcs-panel); border: 1px solid var(--cfcs-line); border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 600; color: var(--cfcs-sub); cursor: pointer; }
.cfcs .cfcs-chip.is-on { background: var(--cfcs-ink); color: #fff; border-color: var(--cfcs-ink); }
.cfcs .cfcs-filter-sep { width: 1px; height: 18px; background: var(--cfcs-line); margin: 0 4px; }
.cfcs .cfcs-owner-filter { border: 1px solid var(--cfcs-line); border-radius: 8px; padding: 5px 8px; font-size: 12px; color: var(--cfcs-ink); background: var(--cfcs-panel); }
.cfcs .cfcs-toolbar-right { display: flex; gap: 14px; }

/* ===== Collapsible phase head ===== */
.cfcs .cfcs-phase-head { width: 100%; background: none; border: none; cursor: pointer; text-align: left; padding: 0; }
.cfcs .cfcs-caret { display: inline-block; width: 0; height: 0; border-left: 6px solid var(--cfcs-faint); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transform: rotate(90deg); transition: transform .15s; flex-shrink: 0; }
.cfcs .cfcs-phase.is-collapsed .cfcs-caret { transform: rotate(0deg); }
.cfcs .cfcs-phase-title { font-size: 17px; font-weight: 700; flex: 1; color: var(--cfcs-ink); }
.cfcs .cfcs-phase-bar { width: 84px; height: 5px; border-radius: 3px; background: var(--cfcs-line); overflow: hidden; }
.cfcs .cfcs-phase-bar span { display: block; height: 100%; background: var(--cfcs-done); }
.cfcs .cfcs-phase.is-collapsed .cfcs-phase-body { display: none; }

/* ===== Item label as button, actions, notes flag ===== */
.cfcs button.cfcs-item-label { display: block; width: 100%; text-align: left; background: none; border: none; padding: 0; cursor: pointer; color: var(--cfcs-ink); font-family: inherit; }
.cfcs button.cfcs-item-label:hover { color: var(--cfcs-ember-deep); text-decoration: underline; }
.cfcs .cfcs-item-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.cfcs .cfcs-open-btn { background: var(--cfcs-panel); border: 1px solid var(--cfcs-line); border-radius: 7px; padding: 4px 11px; font-size: 12px; font-weight: 600; color: var(--cfcs-sub); cursor: pointer; }
.cfcs .cfcs-open-btn:hover { color: var(--cfcs-ink); border-color: var(--cfcs-faint); }
.cfcs .cfcs-has-notes { font-family: ui-monospace, monospace; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--cfcs-sub); background: var(--cfcs-line-soft); padding: 2px 7px; border-radius: 5px; }

/* ===== Full screen item view ===== */
.cfcs-itemview { position: fixed; inset: 0; z-index: 100000; background: var(--cfcs-bg); display: flex; flex-direction: column; }
.cfcs-itemview[hidden] { display: none; }
.cfcs-itemview .cfcs-iv-top { display: flex; align-items: center; justify-content: space-between; padding: 13px 20px; border-bottom: 1px solid var(--cfcs-line); background: var(--cfcs-panel); }
.cfcs-itemview .cfcs-iv-crumb { font-size: 13px; font-weight: 600; color: var(--cfcs-sub); }
.cfcs-itemview .cfcs-iv-scroll { overflow-y: auto; flex: 1; }
.cfcs-itemview .cfcs-iv-inner { max-width: 1000px; margin: 0 auto; padding: 24px 20px 64px; display: grid; grid-template-columns: 1fr 220px; gap: 30px; }
.cfcs-itemview .cfcs-iv-task { font-size: 16px; font-weight: 600; }
.cfcs-itemview .cfcs-iv-savebar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.cfcs-itemview .cfcs-iv-saved { font-size: 12px; color: var(--cfcs-done); }
.cfcs-itemview .cfcs-iv-side .cfcs-iv-status { display: flex; flex-direction: column; gap: 6px; }
.cfcs-itemview .cfcs-iv-status button { text-align: left; padding: 8px 12px; border: 1px solid var(--cfcs-line); border-radius: 8px; background: var(--cfcs-panel); cursor: pointer; font-size: 13px; color: var(--cfcs-ink); }
.cfcs-itemview .cfcs-iv-status button.is-on { border-color: var(--cfcs-ember); background: var(--cfcs-ember-soft); color: var(--cfcs-ember-deep); font-weight: 600; }

.cfcs-itemview .cfcs-iv-artifacts { margin-top: 28px; border-top: 1px solid var(--cfcs-line); padding-top: 20px; }
.cfcs-itemview .cfcs-iv-art-head h3 { font-size: 15px; margin: 0 0 4px; }
.cfcs-itemview .cfcs-iv-aibar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.cfcs-itemview .cfcs-btn-ai { background: var(--cfcs-ink); color: #fff; border: none; }
.cfcs-itemview .cfcs-btn-ai:hover { background: #000; color: #fff; }
.cfcs-itemview .cfcs-btn-ai:disabled { opacity: .6; cursor: default; }
.cfcs-itemview .cfcs-iv-custom { margin-bottom: 16px; }
.cfcs-itemview .cfcs-art { border: 1px solid var(--cfcs-line); border-radius: 10px; padding: 14px; margin-bottom: 14px; background: var(--cfcs-panel); }
.cfcs-itemview .cfcs-art-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cfcs-itemview .cfcs-art-kind { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--cfcs-sub); background: var(--cfcs-line-soft); padding: 3px 8px; border-radius: 5px; flex-shrink: 0; }
.cfcs-itemview .cfcs-art-title { flex: 1; margin: 0; }
.cfcs-itemview .cfcs-art-content { font-family: ui-monospace, monospace; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; margin: 0; }
.cfcs-itemview .cfcs-art-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.cfcs-itemview .cfcs-art-saved { font-size: 12px; color: var(--cfcs-done); }

@media (max-width: 820px) { .cfcs-itemview .cfcs-iv-inner { grid-template-columns: 1fr; } }
