/* GoChange CRM design system */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --canvas: #0B0C0F;
  --surface: #131518;
  --raised: #1B1E23;
  --line: #262A30;
  --line-strong: #363B43;
  --text: #E8EAED;
  --text-2: #B6BBC3;
  --muted: #858B95;
  --white: #FFFFFF;
  --accent: #E9D8A6;
  --accent-ink: #0B0C0F;
  --pos: #8FD9AE;
  --neg: #F2907F;
  --warn: #E9D8A6;
  --focus: #E9D8A6;
  --nav-w: 232px;
  --radius: 8px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--canvas); color: var(--text);
  font-family: var(--font); line-height: 1.45;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.nav {
  background: #0A0B0D; border-right: 1px solid var(--line);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.nav .brand { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; padding: 4px 10px 16px; color: var(--accent); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius);
  color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--raised); color: var(--white); box-shadow: inset 3px 0 0 var(--accent); }
.nav .ico { width: 18px; text-align: center; opacity: .85; font-size: 15px; }
.nav .grow { flex: 1; }
.nav .search-btn { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted);
  background: var(--surface); font-size: 13.5px; cursor: pointer; width: 100%; font-family: inherit; }
.nav .search-btn kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong);
  border-radius: 4px; padding: 1px 5px; }
.nav .me { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; font-size: 13px; }
.nav .me a { padding: 6px 10px; }
.mobile-bar { display: none; }
main { padding: 26px 32px 56px; max-width: 1240px; width: 100%; min-width: 0; }
input[type=file] { color: var(--muted); font-size: 12.5px; border: 0; background: transparent; padding: 4px 0; }

/* ---- page header ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; color: var(--white); }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 13.5px; font-weight: 600; color: var(--text-2); margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---- buttons ---- */
button, .btn {
  font-family: inherit; font-size: 13.5px; font-weight: 600; border-radius: var(--radius);
  padding: 8px 14px; cursor: pointer; border: 1px solid transparent; line-height: 1.2;
  background: var(--accent); color: var(--accent-ink); transition: background .12s, border-color .12s;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
button:hover, .btn:hover { background: #F3E7BF; text-decoration: none; }
button.sec, .btn.sec { background: transparent; color: var(--text); border-color: var(--line-strong); }
button.sec:hover, .btn.sec:hover { background: var(--surface); border-color: #4A5058; }
button.ghost, .btn.ghost { background: transparent; color: var(--text-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface); color: var(--text); }
button.danger { background: transparent; color: var(--neg); border-color: #5A3530; }
button.danger:hover { background: #2A1A18; }
button.sm, .btn.sm { padding: 5px 10px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: default; }

/* ---- inputs ---- */
input, select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--text); background: var(--canvas);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 7px 10px;
}
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; }
input::placeholder, textarea::placeholder { color: #5E656E; }
option { background: var(--surface); }
label { font-size: 13px; color: var(--text-2); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span4 { grid-column: span 4; }
.form-grid input, .form-grid select { width: 100%; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- surfaces ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 14px; }
.panel.tight { padding: 12px 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 600; color: var(--white); margin-top: 3px; letter-spacing: -0.02em; }
.kpi.hero .v { font-size: 28px; }
.kpi .v.pos { color: var(--pos); }
.kpi .v.neg { color: var(--neg); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.notice { border-left: 3px solid var(--warn); background: var(--surface); padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 10px 0; font-size: 13.5px; }
.notice.ok { border-color: var(--pos); }
.notice.bad { border-color: var(--neg); }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 8px; font-size: 13.5px; }
.empty b { color: var(--text-2); font-weight: 600; display: block; margin-bottom: 4px; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { position: sticky; top: 0; background: var(--raised); color: var(--muted); font-weight: 500; text-align: left;
  padding: 9px 12px; font-size: 12.5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #1B1E22; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
tr.clickable { cursor: pointer; }

/* ---- badges ---- */
.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap; }
.badge.s-prep { border-color: #4A5058; }
.badge.s-wait { border-color: #6B5A2E; color: var(--warn); }
.badge.s-pay { border-color: #2E5A42; color: var(--pos); }
.badge.s-done { background: var(--text); color: #000; border-color: var(--text); }
.badge.s-cancel { color: var(--neg); border-color: #5A3530; }
.badge.s-crypto { border-color: #3E4A6B; color: #A9B8F0; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .warn { color: var(--warn); }

/* ---- pipeline stepper ---- */
.pipeline { display: flex; gap: 4px; margin: 6px 0 16px; flex-wrap: wrap; }
.pipeline .step { flex: 1; min-width: 96px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); background: var(--surface); position: relative; }
.pipeline .step.done { border-color: var(--line-strong); color: var(--text-2); }
.pipeline .step.now { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.pipeline .step .n { font-size: 10.5px; opacity: .7; display: block; }

/* ---- kanban ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 160px; padding: 8px; }
.col h3 { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 4px 6px 10px; display: flex; justify-content: space-between; }
.col h3 span { color: var(--muted); font-weight: 500; }
.col.over { border-color: var(--focus); }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; font-size: 13px; }
.card:active { cursor: grabbing; }
.card .amt { font-weight: 600; color: var(--white); }
.card .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---- action list ---- */
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; gap: 10px; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.tasks li:last-child { border-bottom: 0; }
.tasks .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 2px; background: var(--warn); }
.tasks .dot.bad { background: var(--neg); } .tasks .dot.info { background: var(--muted); }

/* ---- filters ---- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { min-width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg a, .seg button { padding: 6px 12px; font-size: 13px; color: var(--text-2); background: transparent; border: 0; border-radius: 0; font-weight: 500; }
.seg a.on, .seg button.on { background: var(--accent); color: var(--accent-ink); }

/* ---- drop zone ---- */
.drop { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.drop.over { border-color: var(--focus); color: var(--text); }

/* ---- command palette ---- */
.cmdk { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 50; }
.cmdk.open { display: flex; }
.cmdk .box { width: min(640px, 92vw); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.cmdk input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 16px; background: transparent; }
.cmdk .res { max-height: 50vh; overflow: auto; }
.cmdk .r { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; cursor: pointer; font-size: 14px; }
.cmdk .r.sel, .cmdk .r:hover { background: var(--raised); }
.cmdk .r .k { color: var(--muted); font-size: 12px; }
.cmdk .hint { padding: 8px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

/* ---- toasts ---- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--raised); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); padding: 10px 14px;
  border-radius: 6px; font-size: 13.5px; min-width: 240px; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.bad { border-left-color: var(--neg); }

/* ---- auth ---- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .box { width: 360px; background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: 10px; padding: 30px 30px 26px; }
.auth h1 { font-size: 20px; margin: 0 0 6px; color: var(--white); }
.auth p { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.auth ol { padding-left: 18px; color: var(--text-2); font-size: 13.5px; margin: 0 0 14px; }
.auth input { width: 100%; font-size: 20px; letter-spacing: .25em; text-align: center; padding: 11px; margin: 8px 0; font-family: var(--mono); }
.auth button { width: 100%; padding: 11px; font-size: 14px; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .hide-m { display: none !important; }
  td, th { padding: 8px 8px; }
  .badge { font-size: 11px; padding: 2px 6px; }
  .page-head .actions { width: 100%; }
  .nav { display: none; }
  main { padding: 16px 14px 84px; }
  .mobile-bar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0;
    background: #0A0B0D; border-top: 1px solid var(--line); z-index: 40; }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 10px; font-size: 11px; color: var(--muted); }
  .mobile-bar a.active { color: var(--white); }
  .mobile-bar .ico { font-size: 17px; }
  .two-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span4 { grid-column: span 2; }
  .kpi .v { font-size: 19px; }
  .page-head h1 { font-size: 19px; }
  button, .btn { padding: 10px 14px; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2, .form-grid .span4 { grid-column: span 1; }
}
