/* Partner Workspace · Argent Reach × Business Hub OS
   One design system, two themes. Dark is the default and matches the
   public site: black surfaces, silver panels, red #C51F32 borders.
   Light is a full clean theme with the same black, red and silver identity.
   Palette rule (Anton, Oct 14 2026): black, red and silver ONLY. No blue. */

:root, :root[data-theme="dark"] {
  --bg: #000000;
  --bg-grad-1: #101216;
  --bg-grad-2: #000000;
  --panel: linear-gradient(165deg, #E9EDF1 0%, #C9D0D8 58%, #AEB7C0 100%);
  --panel-2: #0A0A0B;
  --panel-3: #1A1D21;
  --line: #C51F32;
  --line-soft: rgba(197, 31, 50, .4);
  --ink: #EDF1F5;
  --muted: #C9D1D9;
  --faint: #9BA1A6;
  --red: #C51F32;
  --red-bright: #E5485C;
  --red-soft: rgba(197, 31, 50, .16);
  --silver: #C9D1D9;
  --chip: #1A1D21;
  --input: #101216;
  --ok: #C9D1D9;
  --warn: #F28A94;
  --info: #9E1626;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --logo-plate: #EDF1F5;
  --hero-grad-1: #101216;
  --hero-grad-2: #000000;
}
:root[data-theme="light"] {
  --bg: #EFEFEF;
  --bg-grad-1: #E3E6EA;
  --bg-grad-2: #F4F4F5;
  --panel: linear-gradient(180deg, #FFFFFF 0%, #EDF0F3 100%);
  --panel-2: #F2F3F5;
  --panel-3: #E4E7EB;
  --line: #C51F32;
  --line-soft: rgba(197, 31, 50, .3);
  --ink: #16191D;
  --muted: #454B52;
  --faint: #6E757C;
  --red: #C51F32;
  --red-bright: #A81628;
  --red-soft: rgba(197, 31, 50, .08);
  --silver: #565D63;
  --chip: #E7EAED;
  --input: #FFFFFF;
  --ok: #C9D1D9;
  --warn: #F28A94;
  --info: #9E1626;
  --shadow: 0 8px 24px rgba(0, 0, 0, .10);
  --logo-plate: #FFFFFF;
  --hero-grad-1: #101216;
  --hero-grad-2: #000000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, var(--bg-grad-1), var(--bg) 340px, var(--bg-grad-2));
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -.01em; }
a { color: var(--info); }
.skip { position: absolute; left: -999px; top: 0; background: var(--red); color: #fff; padding: 10px 16px; z-index: 50; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: linear-gradient(100deg, #17191D, #0B0B0D 55%, #000000);
  border-bottom: 3px solid var(--red);
  color: #EDF1F5;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo-plate {
  background: var(--logo-plate); border: 1px solid rgba(192,198,206,.55);
  border-radius: 10px; padding: 6px 12px; display: inline-flex; align-items: center; flex: none;
}
.logo-plate img { height: 34px; width: auto; display: block; }
.logo-plate .lockup { font-weight: 800; font-size: 15px; color: #16191D; white-space: nowrap; }
.logo-plate .lockup b { color: var(--red); font-weight: 800; }
.brand-text strong { display: block; font-size: 17px; }
.brand-text small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #C9D1D9; margin-top: 2px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.save-status { font-size: 12px; color: #C9D1D9; }
.theme-toggle {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  color: #EDF2F7; background: rgba(255,255,255,.08);
  border: 1px solid rgba(192,198,206,.5); border-radius: 999px; padding: 8px 16px;
}
.theme-toggle:hover { background: rgba(255,255,255,.16); }
.vault-link {
  font-size: 13px; font-weight: 700; text-decoration: none;
  color: #EDF2F7; background: rgba(255,255,255,.08);
  border: 1px solid rgba(192,198,206,.5); border-radius: 999px; padding: 8px 16px;
}
.vault-link:hover { background: rgba(255,255,255,.16); }

/* Layout */
.layout { display: grid; grid-template-columns: 248px 1fr; max-width: 1360px; margin: 0 auto; align-items: start; }
.sidebar { padding: 22px 16px; position: sticky; top: 76px; }
.navbtn {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  color: var(--muted); background: none; border: none; border-radius: 10px; padding: 11px 14px; margin-bottom: 4px;
}
.navbtn:hover { background: var(--panel-3); color: var(--ink); }
.navbtn.on { background: var(--panel); color: var(--ink); box-shadow: inset 3px 0 0 var(--red); border: 1px solid var(--line-soft); }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 8px; }
.side-block { margin-top: 22px; border: 1px solid var(--line-soft); background: var(--panel-2); border-radius: 14px; padding: 16px; }
.side-block h3 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.side-block a { display: block; font-size: 14px; font-weight: 600; text-decoration: none; padding: 5px 0; color: var(--muted); }
.side-block a:hover { color: var(--ink); }
.side-block p { font-size: 13px; line-height: 1.55; color: var(--muted); }
main { padding: 26px 26px 40px; min-width: 0; }
main:focus { outline: none; }

/* Generic building blocks */
.view-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.view-head h1 { font-size: 27px; }
.view-head .sub { color: var(--muted); font-size: 14.5px; margin-top: 5px; max-width: 720px; line-height: 1.5; }
.view-head .spacer { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.card h2 { font-size: 17px; margin-bottom: 6px; }
.card h3 { font-size: 15px; margin-bottom: 10px; }
.card .hint { font-size: 13px; color: var(--muted); line-height: 1.55; }
/* Silver panels carry dark text in both themes, like the public site:
   local tokens flip ink/muted/faint/input so silver surfaces stay readable. */
.card, .stat, .pcard, .navbtn.on {
  --ink: #16191D; --muted: #33383E; --faint: #59616A;
  --chip: #D8DEE5; --input: #FFFFFF; --panel-2: #DDE3E9; --panel-3: #C9D0D8;
  --line: #C51F32; --line-soft: rgba(197, 31, 50, .45);
  color: #16191D;
}
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stack > * + * { margin-top: 16px; }

.btn {
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 10px; padding: 10px 18px; border: 1px solid transparent;
  background: #101216; color: #fff;
}
:root[data-theme="light"] .btn { background: #101216; color: #fff; }
.btn:hover { filter: brightness(1.15); }
.btn.red { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel-3); filter: none; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: transparent; color: var(--red-bright); border-color: var(--red); }

.pill { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; border-radius: 999px; padding: 4px 11px; white-space: nowrap; border: 1px solid; }
.pill.stage-Pre-Qualified { color: #C9D1D9; border-color: #59616A; background: #101216; }
.pill.stage-Qualified { color: #FFFFFF; border-color: #C9D1D9; background: #101216; }
.pill.stage-Defined, .pill.stage-Approach { color: var(--warn); border-color: var(--red); background: #101216; }
.pill.stage-Contract { color: #fff; border-color: var(--red); background: var(--red); }
.pill.stage-Won { color: #16191D; background: linear-gradient(165deg, #E9EDF1, #AEB7C0); border-color: #AEB7C0; }
.pill.stage-Lost { color: #9BA1A6; border-color: #454B51; background: #2A2D31; }
.pill.soft { color: var(--muted); border-color: var(--line); background: var(--chip); letter-spacing: .02em; }
.pill.sample { color: var(--warn); border-color: var(--red); background: #101216; }

/* Dashboard */
.stat { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px; }
.stat .v { font-size: 29px; font-weight: 800; }
.stat .l { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.stagebar { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.stagebar:last-child { border-bottom: none; }
.stagebar .nm { width: 130px; flex: none; font-weight: 600; }
.stagebar .track { flex: 1; height: 9px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.stagebar .fill { height: 100%; background: linear-gradient(90deg, #6E757C, var(--red)); border-radius: 99px; }
:root[data-theme="light"] .stagebar .fill { background: linear-gradient(90deg, #9BA1A6, var(--red)); }
.stagebar .ct { width: 28px; text-align: right; font-weight: 800; }
.listrow { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.listrow:last-child { border-bottom: none; }
.listrow .grow { flex: 1; min-width: 0; }
.listrow .meta { color: var(--faint); font-size: 12.5px; }
.empty { color: var(--muted); font-size: 14px; line-height: 1.6; padding: 8px 0; }

/* Roster */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type="search"], .toolbar select { max-width: 260px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px; }
.pcard { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px; cursor: pointer; box-shadow: var(--shadow); text-align: left; font: inherit; color: inherit; width: 100%; }
.pcard:hover { border-color: var(--line); transform: translateY(-1px); }
.pcard .top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar { position: relative; width: 46px; height: 46px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #fff; background: linear-gradient(135deg, #565D63, #101216); border: 1px solid rgba(192,198,206,.35); overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 5px; box-sizing: border-box; background: #fff; }
.pcard .nm { font-weight: 800; font-size: 16px; }
.pcard .co { color: var(--muted); font-size: 13.5px; }
.pcard .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.pcard .meta { font-size: 12.5px; color: var(--faint); margin-top: 10px; line-height: 1.5; }

/* Profile */
.hero { background: linear-gradient(115deg, var(--hero-grad-1), var(--hero-grad-2)); color: #EDF1F5; border-radius: 18px; padding: 26px; margin-bottom: 16px; border-bottom: 4px solid var(--red); }
.hero .top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hero .avatar { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.hero .avatar img { padding: 7px; }
.hero h1 { font-size: 26px; }
.hero .co { color: #C9D1D9; font-size: 15px; margin-top: 3px; }
.hero .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.backlink { display: inline-block; margin-bottom: 14px; color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; background: none; border: none; cursor: pointer; font: inherit; }
.backlink:hover { color: var(--ink); }

/* Forms */
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.field.wide { grid-column: 1 / -1; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], input[type="search"], select, textarea {
  font: inherit; font-size: 14.5px; color: var(--ink); background: var(--input);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }
.kv a { font-weight: 600; text-decoration: none; }
.kv b { text-align: right; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 10px 12px; border-bottom: 2px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td select { width: auto; min-width: 132px; padding: 7px 10px; font-size: 13.5px; }
.linklike { background: none; border: none; font: inherit; font-weight: 700; color: var(--info); cursor: pointer; padding: 0; text-align: left; }

/* Intake */
details.schema { border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; background: var(--panel-2); }
details.schema summary { cursor: pointer; font-weight: 700; font-size: 14.5px; }
details.schema pre { margin-top: 12px; font-size: 12.5px; line-height: 1.55; overflow: auto; background: var(--input); border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px; color: var(--muted); }
.drop { border: 1.5px dashed var(--line); border-radius: 14px; padding: 18px; background: var(--panel-2); }

/* Activity + follow-ups */
.act { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.act:last-child { border-bottom: none; }
.act .when { color: var(--faint); font-size: 12.5px; flex: none; width: 118px; }
.fu { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.fu:last-child { border-bottom: none; }
.fu input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--red); }
.fu .done { text-decoration: line-through; color: var(--faint); }
.fu .due { color: var(--faint); font-size: 12.5px; }

/* Footer + toast */
.foot { border-top: 1px solid var(--line-soft); padding: 18px 26px 26px; color: var(--faint); font-size: 12px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; max-width: 1360px; margin: 0 auto; }
.foot b { color: var(--red-bright); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; background: #101216; color: #fff; border: 1px solid rgba(192,198,206,.4); border-left: 4px solid var(--red); border-radius: 12px; padding: 13px 18px; font-size: 14px; font-weight: 600; box-shadow: 0 14px 34px rgba(0,0,0,.4); max-width: min(420px, 90vw); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: block; padding-bottom: 0; }
  #main-nav { display: flex; overflow-x: auto; gap: 4px; }
  .navbtn { white-space: nowrap; width: auto; }
  .side-block { display: none; }
  main { padding: 18px 16px 34px; }
  .topbar { padding: 10px 14px; }
  .logo-plate img { height: 26px; }
  .brand-text small { display: none; }
  .save-status { display: none; }
}

/* Mobile pass (Anton, Oct 15 2026): phone-friendly workspace.
   Desktop rules above are untouched; everything in this section applies
   at tablet/phone widths only. Forms in this app are inline views (no
   modal markup exists), so single-column form rules cover dialogs too. */
@media (max-width: 860px) {
  html, body { overflow-x: clip; }
  #main-nav .navbtn { min-height: 44px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
}

@media (max-width: 560px) {
  /* Readability: nothing smaller than 13px for meta text, 16px in fields */
  .listrow .meta, .pcard .meta, .act .when, .fu .due { font-size: 13px; }
  input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
  input[type="date"], input[type="search"], select, textarea { font-size: 16px; min-height: 44px; }
  textarea { min-height: 96px; }

  /* Comfortable thumb targets */
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding: 9px 14px; }
  .theme-toggle { min-height: 44px; }
  .linklike { padding: 6px 0; }
  .backlink { padding: 8px 0; }
  td select { min-height: 44px; }

  /* Top bar wraps instead of squeezing */
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .theme-toggle { padding: 8px 14px; }

  /* Single-column everything; stat tiles go 2-compact */
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .roster { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .view-head h1 { font-size: 23px; }
  .stat .v { font-size: 25px; }

  /* Profile hero wraps cleanly, nothing overlaps */
  .hero { padding: 18px; }
  .hero h1 { font-size: 22px; }
  .hero .avatar { width: 52px; height: 52px; border-radius: 14px; }

  /* Key/value + activity rows wrap instead of crushing */
  .kv { flex-wrap: wrap; gap: 2px 14px; }
  .kv b { text-align: left; }
  .kv a { overflow-wrap: anywhere; }
  .act { flex-wrap: wrap; }
  .act .when { width: auto; }
  .stagebar { gap: 8px; }
  .stagebar .nm { width: 102px; }

  /* Toolbar fields go full width; form actions stretch for thumbs */
  .toolbar input[type="search"], .toolbar select { max-width: none; width: 100%; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* Tables reflow to stacked cards; headers kept for screen readers */
  table { overflow-x: visible; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  tbody, tr, td { display: block; width: auto; }
  tr { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  tr:last-child { border-bottom: none; }
  td { border-bottom: none; padding: 5px 12px; }
  td select { width: 100%; min-width: 0; }

  .toast { left: 16px; right: 16px; max-width: none; }
}

/* Live feed (feed.js · /api/hub-feed) */
.livefeed .lf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.livefeed .lf-head h2 { margin-bottom: 0; }
.livefeed .lf-grid { margin-top: 14px; }
.livefeed .lf-src { margin-top: 12px; }
.lf-intake { margin-bottom: 6px; }
