/* Partner Hub – light, calm, one blue accent. Inter is served from this folder (no external fonts). */
@font-face { font-family: 'Inter'; src: url(Inter-400.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(Inter-600.ttf) format('truetype'); font-weight: 600 800; font-display: swap; }
:root {
  --blue: #2058da; --blue-2: #1846b8; --blue-soft: #eaf0ff; --navy: #112047; --muted: #5a6985; --line: #e4eaf3;
  --bg: #f4f7fc; --white: #fff; --green: #127046; --green-soft: #e3f7ee; --amber: #875208; --amber-soft: #fff2d9;
  --red: #a3242d; --red-soft: #fde8ea; --shadow: 0 1px 2px #14264b0a, 0 4px 14px #14264b08; --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--navy); font: 14px/1.45 Inter, 'Segoe UI', system-ui, -apple-system, Arial, sans-serif; }
h1, h2, h3 { letter-spacing: -.02em; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid #78a6ff; outline-offset: 2px; }
.hidden { display: none !important; }

/* ---- frame ---- */
aside { position: fixed; inset: 0 auto 0 0; width: 244px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 24px 16px 16px; z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 30px; text-decoration: none; color: inherit; }
.brand img { width: 38px; height: 38px; border-radius: 11px; }
.brand b { display: block; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.navcap { color: #6b7893; margin: 0 11px 8px; text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; font-weight: 700; }
nav { display: grid; gap: 3px; }
nav button { border: 0; background: none; text-align: left; border-radius: 10px; padding: 10px 11px; display: flex; align-items: center; gap: 11px; color: #45557a; font-weight: 600; }
nav button svg { width: 18px; height: 18px; flex: none; }
nav button:hover { background: #f3f6fc; }
nav button.active { background: var(--blue-soft); color: var(--blue-2); }
nav button i { margin-left: auto; font-style: normal; background: var(--blue); color: #fff; border-radius: 20px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.account { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--blue-soft); color: var(--blue-2); font-weight: 800; font-size: 12px; }
.account .who { min-width: 0; flex: 1; }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account small { color: var(--muted); font-size: 12px; }
.iconbtn { border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 34px; height: 34px; display: grid; place-items: center; flex: none; color: var(--muted); }
.iconbtn:hover { color: var(--navy); border-color: #b9c8e6; }
.iconbtn svg { width: 17px; height: 17px; }
.shell { margin-left: 244px; min-height: 100vh; }
header { min-height: 66px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 30px; position: sticky; top: 0; z-index: 4; }
.crumb { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--navy); }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.control, .btn { border: 1px solid #d9e2ef; background: #fff; border-radius: 9px; padding: 8px 12px; font-weight: 600; min-height: 38px; }
select.control { padding-right: 28px; max-width: 280px; }
.btn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover, .control:hover { border-color: #7a9be6; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); }
.btn.danger { color: var(--red); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.pill { font-size: 11.5px; font-weight: 700; display: inline-block; white-space: nowrap; padding: 3px 9px; border-radius: 100px; background: var(--blue-soft); color: #2455c9; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.grey { background: #edf0f5; color: #56627a; }
.content { padding: 24px 30px 48px; max-width: 1480px; margin: 0 auto; }

/* ---- blocks ---- */
.hero { border-radius: 18px; overflow: hidden; background: linear-gradient(115deg, #0f2a72, #1f52cf 72%, #2c66e8); padding: 28px 30px; color: #fff; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 160px; }
.hero::after { content: ''; position: absolute; right: -50px; top: -160px; width: 460px; height: 460px; border-radius: 50%; border: 1px solid #ffffff26; box-shadow: 0 0 0 36px #ffffff08, 0 0 0 72px #ffffff09, 0 0 0 108px #ffffff0a; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 700; color: #c7d7ff; }
.hero h1 { margin: 6px 0 4px; font-size: clamp(24px, 2.8vw, 36px); font-weight: 800; }
.hero p { margin: 0; color: #e1eaff; max-width: 560px; }
.hero .btn { color: var(--blue-2); border-color: #fff; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero-meta .pill { background: #ffffff1f; color: #fff; }
.section { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.section h1 { font-size: 24px; font-weight: 800; }
.section h2 { font-size: 17px; font-weight: 700; }
.under { margin: -4px 0 18px; color: var(--muted); max-width: 760px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.stat { padding: 16px 18px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13px; }
.stat-top .avatar { width: 32px; height: 32px; border-radius: 10px; }
.stat-top .avatar svg { width: 17px; height: 17px; }
.stat strong { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.grid2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cardhead { padding: 18px 18px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cardhead h2 { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.cardhead p { margin: 0; color: var(--muted); font-size: 12.5px; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--blue); vertical-align: 0; }
.legend span.c2::before { background: #2bb287; }
.chart { padding: 8px 12px 10px; position: relative; }
.chart canvas { display: block; width: 100%; height: 240px; }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; }
.tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: 0 6px 20px #11204733; }
.pipeline { padding: 16px 18px 8px; }
.prow { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.track { grid-column: 1 / -1; height: 7px; background: #edf1f8; border-radius: 20px; overflow: hidden; }
.track b { display: block; height: 100%; border-radius: 20px; background: var(--blue); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 170px; max-width: 340px; }
th { background: #f8faff; color: #56637d; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.link { border: 0; background: none; padding: 0; color: var(--blue-2); font-weight: 700; text-align: left; }
.link:hover { text-decoration: underline; }
.sub-line { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar input[type=search] { flex: 1 1 260px; min-width: 0; }
.empty { padding: 26px 18px; color: var(--muted); text-align: center; }
.notice { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 11px; background: var(--amber-soft); color: var(--amber); font-weight: 600; margin-top: 14px; }
.notice.blue { background: var(--blue-soft); color: var(--blue-2); }
.notice svg { width: 18px; height: 18px; flex: none; }
.notice .link { color: inherit; text-decoration: underline; margin-left: auto; }

/* ---- network ---- */
.tree { list-style: none; margin: 0; padding: 18px; display: grid; gap: 14px; }
.tree ul { list-style: none; margin: 10px 0 0 22px; padding-left: 20px; border-left: 2px solid #dbe5fa; display: grid; gap: 10px; }
.node { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; border-radius: 12px; flex-wrap: wrap; }
.node.main { background: linear-gradient(0deg, #fff, #fbfcff); }
.node .who { min-width: 180px; flex: 1; }
.node .who strong { display: block; }
.node .facts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---- commission ---- */
.rule { padding: 18px; display: grid; gap: 12px; }
.phase { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.phase.now { border-color: #9db7f3; background: #f6f9ff; }
.phase b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--blue-2); }
.phase span small { display: block; color: var(--muted); font-size: 12px; }
.form { padding: 18px; display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label.field { display: grid; gap: 5px; font-weight: 600; font-size: 13px; }
label.field input, label.field select, label.field textarea { border: 1px solid #d5deec; border-radius: 9px; padding: 9px 11px; background: #fff; font-weight: 400; width: 100%; }
label.field textarea { min-height: 84px; resize: vertical; }
label.check { display: flex; gap: 9px; align-items: center; font-weight: 600; }
.result { display: grid; gap: 8px; padding: 16px 18px; border-top: 1px solid var(--line); background: #fafcff; border-radius: 0 0 var(--r) var(--r); }
.result div { display: flex; justify-content: space-between; gap: 10px; }
.result strong { font-variant-numeric: tabular-nums; }
.result .big strong { font-size: 22px; color: var(--blue-2); }
.muted { color: var(--muted); }

/* ---- dialog + toast ---- */
dialog { border: 1px solid var(--line); color: var(--navy); border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: 0 20px 70px #10255040; }
dialog::backdrop { background: #12234966; }
dialog form { padding: 22px; display: grid; gap: 12px; max-height: calc(100vh - 40px); overflow: auto; }
dialog h2 { font-size: 19px; font-weight: 800; }
dialog p { margin: 0; color: var(--muted); }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.actions .left { margin-right: auto; }
.err { color: var(--red); background: var(--red-soft); border-radius: 9px; padding: 9px 11px; font-weight: 600; }
#toast { position: fixed; bottom: 22px; right: 22px; z-index: 30; background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 10px 30px #11204740; }
#toast:empty { display: none; }

/* ---- login ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 80% -10%, #dbe6ff, transparent), var(--bg); }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 60px #1020500f; padding: 30px; display: grid; gap: 14px; }
.auth-card .brand { margin: 0 0 6px; }
.auth-card h1 { font-size: 24px; font-weight: 800; }
.auth-card .btn { justify-content: center; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }

/* ---- responsive ---- */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid2, .grid2.even { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  aside { position: sticky; top: 0; width: auto; height: auto; padding: 10px 12px; flex-direction: row; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; } .brand small, .brand b { display: none; } .brand img { width: 32px; height: 32px; }
  .navcap { display: none; }
  nav { display: flex; overflow-x: auto; gap: 2px; flex: 1; scrollbar-width: none; }
  nav button { white-space: nowrap; padding: 8px 10px; }
  .account { margin: 0; padding: 0; border: 0; } .account .who, .account .avatar { display: none; }
  .shell { margin-left: 0; }
  header { position: static; padding: 10px 14px; }
  .content { padding: 16px 14px 40px; }
  .crumb { display: none; } .controls { width: 100%; justify-content: flex-start; } select.control { flex: 1; max-width: none; }
}
@media (max-width: 560px) {
  nav button svg { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 12px; } .stat strong { font-size: 20px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .row2 { grid-template-columns: 1fr; }
  th, td { padding: 10px 12px; }
}
