/* portal/css/main.css
   Minimal v0.1 styling. The Layer 2 design system (brand colours, type
   scale, components from Claude Design via the handoff bundle) lands in
   v0.2 once the bundle reaches design-system/<brand>/.

   Until then this stylesheet exists only to make the structure visible
   and the workflow testable. Do not invest in polish here.
*/

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  background: #f7f7f5;
  color: #1a1a1a;
  line-height: 1.4;
}

/* Header */

header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e3e3e0;
}

header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.version {
  color: #707070;
  font-size: 0.8rem;
}

.spacer { flex: 1; }

.error {
  color: #b00020;
  font-size: 0.85rem;
  max-width: 30rem;
  text-align: right;
}

.signout {
  color: #444;
  text-decoration: none;
  font-size: 0.85rem;
}
.signout:hover { color: #000; text-decoration: underline; }

/* Kanban */

.kanban {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  min-height: calc(100vh - 3.5rem);
}

.column.column-post-send {
  background: #f3f3f0;
  border-color: #d0d0cc;
}

.column.column-post-send h2 {
  color: #555;
}

.column {
  background: #ffffff;
  border: 1px solid #e3e3e0;
  border-radius: 4px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.column h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ececea;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

/* Card */

.card {
  background: #fafaf8;
  border: 1px solid #e3e3e0;
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.card:hover { background: #f3f3f0; }

.card .ref {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  color: #555;
  font-size: 0.7rem;
}
.card .customer {
  font-weight: 600;
  margin-top: 0.2rem;
}
.card .value {
  color: #555;
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.empty {
  color: #a0a0a0;
  font-size: 0.85rem;
  margin: 0;
  padding: 0.25rem 0;
  font-style: italic;
}

/* Login */

.login {
  max-width: 32rem;
  margin: 5rem auto;
  padding: 2.5rem;
  background: #ffffff;
  border: 1px solid #e3e3e0;
  border-radius: 4px;
  text-align: center;
}

.login h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.login .lede {
  color: #555;
  margin: 0 0 1.5rem;
}

.login .stub-notice {
  background: #fdf6e3;
  border: 1px solid #ead9a0;
  border-radius: 3px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  text-align: left;
  margin: 0 0 1.5rem;
}

.login .stub-notice code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  background: #f3eac6;
  padding: 0 0.25rem;
  border-radius: 2px;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #1a1a1a;
  color: #ffffff;
  text-decoration: none;
  border-radius: 3px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: #000000; }
.btn:disabled { background: #888; cursor: not-allowed; }

.btn-header {
  padding: 0.35rem 0.8rem;
  background: #1a1a1a;
  color: #ffffff;
  text-decoration: none;
  border-radius: 3px;
  font-size: 0.85rem;
}
.btn-header:hover { background: #000; }

/* Brief intake form */

.form-page {
  max-width: 48rem;
  margin: 2rem auto;
  padding: 0 1.5rem 4rem;
}

.form-page h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.form-page .lede {
  color: #555;
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.brief-form fieldset {
  border: 1px solid #e3e3e0;
  border-radius: 4px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1.5rem;
  background: #ffffff;
}

.brief-form legend {
  padding: 0 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #444;
}

.brief-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.brief-form .field.hidden { display: none; }

.brief-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

.brief-form input[type="text"],
.brief-form input[type="number"],
.brief-form select,
.brief-form textarea {
  padding: 0.5rem 0.6rem;
  border: 1px solid #d0d0cc;
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #ffffff;
}

.brief-form input:focus,
.brief-form select:focus,
.brief-form textarea:focus {
  outline: none;
  border-color: #555;
  box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.1);
}

.brief-form textarea {
  resize: vertical;
  min-height: 4rem;
}

.brief-form .hint {
  color: #707070;
  font-size: 0.8rem;
  margin: 0;
}

.brief-form .hint a { color: #555; }

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.status-msg {
  font-size: 0.85rem;
  color: #555;
}

.status-msg.error-msg {
  color: #b00020;
}

/* Create-customer section */

.create-customer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px dashed #d0d0cc;
}

.create-customer h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.create-customer code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  background: #f3eac6;
  padding: 0 0.3rem;
  border-radius: 2px;
  font-size: 0.85em;
}

/* Composition workspace */

.composition-page {
  display: grid;
  grid-template-columns: 14rem 1fr 1fr;
  gap: 1rem;
  padding: 1rem 1.5rem;
  min-height: calc(100vh - 3.5rem);
}

.composition-meta {
  background: #fff;
  border: 1px solid #e3e3e0;
  border-radius: 4px;
  padding: 1rem;
  height: fit-content;
}

.composition-meta .meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin: 0.4rem 0;
}

.composition-meta .meta-label {
  color: #707070;
}

.composition-slots,
.composition-preview {
  background: #fff;
  border: 1px solid #e3e3e0;
  border-radius: 4px;
  padding: 1rem 1.25rem 1.25rem;
}

.composition-slots h2,
.composition-preview h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.composition-slots .lede,
.composition-preview .lede {
  color: #707070;
  margin: 0 0 1rem;
  font-size: 0.8rem;
}

.composition-slots fieldset {
  border: 1px solid #ececea;
  border-radius: 3px;
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 0.75rem;
  background: #fafaf8;
}

.composition-slots legend {
  padding: 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  text-transform: lowercase;
}

.composition-slots .module-line {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: #555;
  margin: 0 0 0.35rem;
}

.composition-slots .param-input {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.5rem 0 0;
}

.composition-slots .param-input label {
  font-size: 0.8rem;
  color: #555;
}

.composition-slots .param-input textarea {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.82rem;
  padding: 0.5rem;
  border: 1px solid #d0d0cc;
  border-radius: 3px;
  background: #fff;
}

.preview-frame {
  border: 1px solid #ececea;
  border-radius: 3px;
  padding: 1.25rem;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.55;
  max-height: 70vh;
  overflow-y: auto;
}

.preview-frame p {
  margin: 0 0 0.8rem;
}

.preview-frame p.bolded-close {
  margin-top: 1.2rem;
  margin-bottom: 1.5rem;
}

.preview-frame .missing-param {
  background: #fff3a0;
  color: #6b5500;
  padding: 0 0.2rem;
  border-radius: 2px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
}

.preview-frame ol.slot-clauses {
  padding-left: 1.5rem;
}

.preview-frame ol.slot-clauses li {
  margin-bottom: 0.6rem;
}

/* Validator panel */

.validator-panel {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #ececea;
}

.validator-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.validator-row {
  background: #fafaf8;
  border: 1px solid #ececea;
  border-left: 4px solid #ccc;
  border-radius: 3px;
  padding: 0.6rem 0.8rem;
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}

.validator-row.validator-pass { border-left-color: #2c8e3e; }
.validator-row.validator-warning { border-left-color: #d4a017; }
.validator-row.validator-fail { border-left-color: #b00020; }

.validator-name {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-weight: 600;
}

.validator-status {
  float: right;
  font-weight: 600;
  font-size: 0.8rem;
}

.validator-row.validator-pass .validator-status { color: #2c8e3e; }
.validator-row.validator-warning .validator-status { color: #b87f00; }
.validator-row.validator-fail .validator-status { color: #b00020; }

.validator-findings {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: #444;
}

.validator-findings li {
  margin-bottom: 0.3rem;
}

.finding-severity-high { color: #b00020; }
.finding-severity-medium { color: #b87f00; }
.finding-severity-low { color: #5e7281; }

.btn-strong {
  background: #1a4a2e;
}
.btn-strong:hover { background: #0d3520; }

.btn-bounce {
  background: #b00020;
}
.btn-bounce:hover { background: #800018; }

/* Gate pages (QC and Approval) */

.gate-page {
  display: grid;
  grid-template-columns: 22rem 1fr;
  gap: 1rem;
  padding: 1rem 1.5rem;
  min-height: calc(100vh - 3.5rem);
}

.gate-page .composition-meta {
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.gate-page .composition-meta h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.gate-page .composition-meta h3 {
  margin: 1.25rem 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}

.gate-page .composition-meta textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d0d0cc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}

.actions-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 1rem;
}

.actions-stacked .btn {
  width: 100%;
  text-align: center;
}

.gate-preview,
.gate-recommendation {
  background: #fff;
  border: 1px solid #e3e3e0;
  border-radius: 4px;
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
}

.gate-preview h2,
.gate-recommendation h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.gate-preview .lede,
.gate-recommendation .lede {
  color: #707070;
  margin: 0 0 1rem;
  font-size: 0.8rem;
}

.agent-note {
  color: #999;
  font-size: 0.75em;
  font-weight: 400;
  margin-left: 0.4rem;
}

/* Approval recommendation panel */

.recommendation-frame {
  border: 1px solid #ececea;
  border-radius: 3px;
  padding: 1rem;
  background: #fafaf8;
}

.verdict {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0.8rem;
  border-radius: 3px;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.verdict-approve {
  background: #e3f5e7;
  color: #1a5d28;
  border-left: 4px solid #2c8e3e;
}

.verdict-escalate {
  background: #fdecea;
  color: #5b0010;
  border-left: 4px solid #b00020;
}

.verdict .agent-version {
  font-size: 0.75rem;
  color: #707070;
  font-weight: 400;
}

.recommendation-frame .summary {
  margin: 0 0 1rem;
  color: #444;
  font-size: 0.9rem;
}

.rec-list {
  margin: 0 0 1rem;
}

.rec-list h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: #444;
}

.rec-list ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: #333;
}

.rec-list li {
  margin-bottom: 0.3rem;
}

.rec-hard h3 { color: #b00020; }
.rec-hard ul li { color: #5b0010; }

.rec-soft h3 { color: #b87f00; }
.rec-soft ul li { color: #6b5500; }

.rec-green h3 { color: #1a5d28; }
.check-pass { color: #1a5d28; }
.check-fail { color: #b00020; }
