/* SC Placements — design system
   Boardroom green + porcelain + copper. Display: Bricolage Grotesque.
   UI: Instrument Sans. Data/money/IDs: Spline Sans Mono. */

:root {
  --green-deep: #142620;
  --green-ink: #1d3830;
  --green-soft: #27473c;
  --canvas: #eff2ee;
  --surface: #ffffff;
  --surface-2: #f7f9f6;
  --ink: #17231e;
  --muted: #5d6d65;
  --faint: #8b978f;
  --line: #dde4dd;
  --line-strong: #c6d0c6;
  --copper: #c05b33;
  --copper-dark: #a2481f;
  --copper-soft: #f6e8e1;
  --gold: #b1841f;
  --gold-soft: #f5ecd8;
  --win: #2f7a4d;
  --win-soft: #e2f0e7;
  --steel: #4e7a9e;
  --steel-soft: #e5edf3;
  --slate: #75857e;
  --slate-soft: #eaeeea;
  --danger: #a83232;
  --danger-soft: #f6e4e4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 35, 30, 0.06), 0 4px 16px rgba(23, 35, 30, 0.05);
  --shadow-lift: 0 2px 6px rgba(23, 35, 30, 0.1), 0 12px 32px rgba(23, 35, 30, 0.12);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-ui: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Spline Sans Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }

:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

/* ---------- shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 228px;
  flex-shrink: 0;
  background: var(--green-deep);
  color: #dbe6df;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand .mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.brand .mark .tick { color: var(--copper); font-size: 24px; line-height: 0; }

.brand .tag {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7e948a;
}

.nav { padding: 14px 10px; flex: 1; overflow-y: auto; }

.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6d8177;
  padding: 14px 12px 6px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: #c2d1c9;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.nav button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.nav button.active {
  background: var(--green-soft);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--copper);
}

.nav button .n-icon { width: 18px; text-align: center; opacity: 0.85; }

.nav button .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: 99px;
}

.sidebar-foot {
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #7e948a;
  line-height: 1.5;
}

/* ---------- main ---------- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar .spacer { flex: 1; }

.viewas {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 6px 5px 14px;
}

.viewas label { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.viewas select {
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 4px;
  max-width: 180px;
}

.portal-banner {
  background: var(--green-ink);
  color: #e8efe9;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
}

.portal-banner strong { font-family: var(--font-display); font-weight: 600; }

.portal-banner .exit {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}

.portal-banner .exit:hover { background: rgba(255, 255, 255, 0.22); }

.content { padding: 26px 28px 48px; max-width: 1280px; width: 100%; }

/* ---------- shared bits ---------- */

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.page-head h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }

.page-head .actions { margin-left: auto; display: flex; gap: 10px; }

.btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13.5px;
}

.btn:hover { border-color: var(--faint); }

.btn.primary { background: var(--copper); border-color: var(--copper); color: #fff; }
.btn.primary:hover { background: var(--copper-dark); border-color: var(--copper-dark); }

.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); background: var(--slate-soft); }

.btn.danger { color: var(--danger); border-color: var(--danger); background: var(--surface); }
.btn.danger:hover { background: var(--danger-soft); }

.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.chip .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.chip.win { background: var(--win-soft); color: var(--win); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.copper { background: var(--copper-soft); color: var(--copper-dark); }
.chip.steel { background: var(--steel-soft); color: var(--steel); }
.chip.slate { background: var(--slate-soft); color: var(--slate); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }

.mono { font-family: var(--font-mono); font-size: 0.92em; }

.empty {
  padding: 42px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty .big { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }

/* ---------- dashboard ---------- */

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }

.kpi { padding: 18px 18px 16px; }

.kpi .k-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.kpi .k-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 6px;
  line-height: 1;
}

.kpi .k-value.money { font-size: 28px; }

.kpi .k-note { font-size: 12.5px; color: var(--muted); margin-top: 7px; }

.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
}

.panel-title .link { margin-left: auto; font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--copper-dark); background: none; border: 0; }
.panel-title .link:hover { text-decoration: underline; }

/* pipeline snapshot bars */
.snap { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }

.snap-row { display: grid; grid-template-columns: 130px 1fr 34px; align-items: center; gap: 12px; }

.snap-row .s-label { font-size: 13px; font-weight: 600; color: var(--muted); }

.snap-bar { height: 22px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }

.snap-bar .fill { height: 100%; border-radius: 5px; min-width: 4px; transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }

.snap-row .s-count { font-family: var(--font-mono); font-size: 13px; text-align: right; }

.feed { padding: 6px 0; }

.feed-item { display: flex; gap: 12px; padding: 10px 18px; font-size: 13.5px; line-height: 1.45; }

.feed-item + .feed-item { border-top: 1px solid var(--surface-2); }

.feed-item .f-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; padding-top: 2px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td { padding: 12px 16px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }

tr:last-child td { border-bottom: 0; }

tbody tr.rowlink { cursor: pointer; }
tbody tr.rowlink:hover { background: var(--surface-2); }

td .primary-cell { font-weight: 600; }
td .sub-cell { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- filter bar ---------- */

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

.filters input[type="search"], .filters select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface);
  min-width: 160px;
}

.filters input[type="search"] { min-width: 230px; }

.filters .count { font-size: 13px; color: var(--muted); margin-left: auto; }

/* ---------- rep cards ---------- */

.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.rep-card { padding: 16px; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }

.rep-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }

.rep-card .r-top { display: flex; align-items: flex-start; gap: 12px; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--green-ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rep-card .r-name { font-weight: 700; font-size: 15px; }
.rep-card .r-title { font-size: 13px; color: var(--muted); margin-top: 1px; }
.rep-card .r-status { margin-left: auto; }

.rep-card .r-meta { display: flex; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

.rep-card .r-skills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.skill-tag {
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 6px;
}

.stars { color: var(--gold); font-size: 12px; letter-spacing: 1px; }

/* ---------- kanban ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 12px;
  overflow-x: auto;
  align-items: start;
  padding-bottom: 8px;
}

.col { background: var(--slate-soft); border-radius: var(--radius); min-height: 220px; }

.col.dragover { outline: 2px dashed var(--copper); outline-offset: -2px; }

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
}

.col-head .c-count { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.col-head .c-dot { width: 9px; height: 9px; border-radius: 99px; }

.col-cards { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 12px; }

.ticket {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 11px 12px 10px;
  border-top: 3px solid var(--slate);
  cursor: grab;
}

.ticket:active { cursor: grabbing; }
.ticket.dragging { opacity: 0.45; }

.ticket .t-rep { font-weight: 700; font-size: 14px; }
.ticket .t-role { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.ticket .t-client { font-size: 12px; font-weight: 600; color: var(--green-soft); margin-top: 1px; }

.ticket .t-next {
  margin-top: 9px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 5px 8px;
  line-height: 1.4;
}

.ticket .t-foot { display: flex; align-items: center; margin-top: 9px; gap: 8px; }

.ticket .t-fee { font-family: var(--font-mono); font-size: 12px; color: var(--win); font-weight: 500; }

.ticket .t-move { margin-left: auto; display: flex; gap: 4px; }

.ticket .t-move button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  width: 24px;
  height: 22px;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
}

.ticket .t-move button:hover:not(:disabled) { color: var(--ink); border-color: var(--faint); }
.ticket .t-move button:disabled { opacity: 0.3; cursor: default; }

/* ---------- detail views ---------- */

.back { background: none; border: 0; color: var(--copper-dark); font-weight: 600; font-size: 13.5px; padding: 0; margin-bottom: 14px; }
.back:hover { text-decoration: underline; }

.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }

.detail-head { display: flex; align-items: flex-start; gap: 16px; padding: 20px; flex-wrap: wrap; }

.detail-head .avatar { width: 52px; height: 52px; font-size: 19px; border-radius: 13px; }

.detail-head h2 { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }

.detail-head .d-sub { color: var(--muted); font-size: 14px; margin-top: 3px; }

.detail-head .d-actions { margin-left: auto; display: flex; gap: 8px; }

.fact-list { padding: 6px 20px 16px; }

.fact { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 8px 0; font-size: 13.5px; border-top: 1px solid var(--surface-2); }

.fact .f-k { color: var(--muted); font-weight: 600; }

.note-block { padding: 14px 20px 18px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }

.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 20, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  z-index: 60;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  width: 100%;
  max-width: 520px;
  animation: pop 0.16s ease-out;
}

@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head { display: flex; align-items: center; padding: 18px 22px 0; }

.modal-head h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }

.modal-head .x { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--muted); line-height: 1; padding: 4px; }
.modal-head .x:hover { color: var(--ink); }

.modal form { padding: 16px 22px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }

.modal .field { display: flex; flex-direction: column; gap: 5px; }
.modal .field.full { grid-column: 1 / -1; }

.modal label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }

.modal input, .modal select, .modal textarea {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 11px;
  background: var(--surface);
}

.modal textarea { min-height: 72px; resize: vertical; }

.modal .form-foot { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* ---------- settings ---------- */

.settings-card { padding: 20px; max-width: 620px; }
.settings-card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.settings-card p { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }

/* ---------- auth ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--green-deep);
}

.auth-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
  width: 100%;
  max-width: 420px;
  padding: 30px 30px 26px;
}

.auth-card .mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.auth-card .mark .tick { color: var(--copper); }

.auth-card .auth-sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin-bottom: 20px; }

.auth-card form { display: flex; flex-direction: column; gap: 12px; }

.auth-card .field { display: flex; flex-direction: column; gap: 5px; }

.auth-card label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }

.auth-card input {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

.auth-card .btn.primary { padding: 11px 14px; font-size: 14.5px; margin-top: 6px; }

.auth-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
}

.auth-foot { margin-top: 16px; font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green-deep);
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  z-index: 80;
  animation: pop 0.16s ease-out;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .detail-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(5, 240px); }
}

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; }
  .nav-label { display: none; }
  .nav button { width: auto; padding: 7px 11px; font-size: 13px; }
  .nav button .badge { display: none; }
  .sidebar-foot { display: none; }
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .content { padding: 18px 16px 40px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .modal form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
