/* Partner cabinet — built on the dashboard token set (dashboard.css) */

.partner-app { min-height: 100vh; display: flex; flex-direction: column; }

.partner-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.partner-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.partner-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.partner-title { font-weight: 600; letter-spacing: -0.01em; }
.partner-name {
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-logout {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border-md);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.partner-logout:hover { color: var(--text); border-color: var(--text-dim); }

.partner-main {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ===== STATS =====
   Prefixed on purpose. dashboard.css defines its own .stat-card for the ops
   console — clickable, with overflow:hidden — and it is loaded first, so any
   property this file leaves unset leaked in. That is what clipped the hint
   bubble and put a pointer cursor on cards nobody can click. */

.partner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.partner-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.partner-stat-accent { border-color: rgba(74, 222, 128, 0.35); background: var(--green-bg); }

.partner-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.partner-stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.partner-stat-accent .partner-stat-value { color: var(--green); }
.partner-stat-note { font-size: 12px; color: var(--text-dim); min-height: 1em; }

/* ===== SECTIONS ===== */

.partner-payout,
.partner-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.partner-payout h2,
.partner-section h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ===== PAYOUT FORM ===== */

.payout-form {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

@media (max-width: 720px) {
  .payout-form { grid-template-columns: minmax(0, 1fr); }
}

.payout-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.payout-field label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* One height for every control in the payout row. An explicit height is not
   enough on its own: a native <select> is drawn by the browser with its own
   internal box, so it still sits a couple of pixels off the text input next to
   it. Dropping the native appearance and painting our own arrow makes the two
   render as the same box. */
.payout-field select,
.payout-field input,
.payout-submit {
  height: 42px;
  line-height: normal;
}

.payout-field select,
.payout-field input {
  background: var(--muted);
  border: 1px solid var(--border-md);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.payout-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Chevron in --text-dim; the cabinet has one fixed palette, so a literal
     colour here cannot fall out of step with a theme. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 34px;
  cursor: pointer;
}

.payout-field input { font-family: var(--font-mono); font-size: 13px; }
.payout-field select:focus,
.payout-field input:focus { outline: 2px solid var(--green); outline-offset: 1px; }

.payout-submit {
  background: var(--green);
  color: #0a0a0b;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.payout-submit:hover:not(:disabled) { filter: brightness(1.08); }
.payout-submit:disabled { opacity: 0.6; cursor: default; }

.payout-pending {
  background: var(--yellow-bg);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--yellow);
}

.payout-message { font-size: 13px; display: none; }
.payout-message.visible { display: block; }
.payout-message.ok { color: var(--green); }
.payout-message.error { color: var(--red); }

/* ===== TABLES ===== */

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

.partner-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}

.partner-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 500;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--border-md);
  white-space: nowrap;
}

.partner-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}

.partner-table td:first-child { color: var(--text); font-variant-numeric: tabular-nums; }
.partner-table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.partner-table tr:last-child td { border-bottom: none; }
.partner-table .row-negative td { color: var(--red); }
.partner-table .empty-row td { color: var(--text-dim); text-align: center; padding: 24px 0; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.7;
  white-space: nowrap;
}

.pill-accrued   { background: var(--blue-bg);   color: var(--blue); }
.pill-requested { background: var(--yellow-bg); color: var(--yellow); }
.pill-pending   { background: var(--yellow-bg); color: var(--yellow); }
.pill-paid      { background: var(--green-bg);  color: var(--green); }
.pill-reversed  { background: var(--red-bg);    color: var(--red); }
.pill-rejected  { background: var(--red-bg);    color: var(--red); }

.load-more {
  align-self: center;
  background: transparent;
  border: 1px solid var(--border-md);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
}
.load-more:hover { color: var(--text); border-color: var(--text-dim); }

.hidden { display: none !important; }

/* ===== HINTS ===== */

.hint-wrap { position: relative; display: inline-flex; vertical-align: middle; }

.hint {
  width: 15px;
  height: 15px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-md);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.hint:hover,
.hint[aria-expanded="true"] { color: var(--text); border-color: var(--text-dim); }

/* An emoji is its own glyph — a circle around it just looks like a bug. */
.hint-emoji {
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  font-size: 12px;
}

.hint-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: -6px;
  z-index: 20;
  width: max-content;
  max-width: 300px;
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  /* Labels above are uppercase and letter-spaced; the bubble is prose. */
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  color: var(--text-muted);
}

.hint-bubble-wide { max-width: 380px; }
.hint-bubble strong { color: var(--text); font-weight: 600; }
.hint-bubble a { color: var(--blue); text-decoration: none; }
.hint-bubble a:hover,
.hint-bubble a:focus-visible { text-decoration: underline; }

/* Near the right edge the wide bubble would run off the card. */
@media (max-width: 720px) {
  .hint-bubble { left: auto; right: -6px; max-width: min(300px, 78vw); }
  .hint-bubble-wide { max-width: min(380px, 82vw); }
}
