/* The Clients tab (accounts with the advisor role) and its /demo/advisor sample. Builds on app.css and account.css;
 * the page's dark tokens come from the skin (server.clients_dark_css), so only fixed colors are set here. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.clients-panel { display: grid; gap: 26px; min-height: 0; padding: 22px; }
.clients-panel > .status { margin: 0; }
.clients-panel h2 { font-size: 19px; margin: 0 0 4px; letter-spacing: -.1px; }
.clients-panel p { margin: 0 0 10px; }

/* Invite a client: one block, two fields side by side on a wide screen. */
.invite-card { border: 2px solid var(--line); border-radius: 12px; padding: 18px; background: var(--paper);
  box-shadow: 0 3px 0 var(--line); }
.invite-form { gap: 12px; margin: 12px 0 0; }
.invite-form .field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.invite-form .btn { justify-self: start; }
.note { border: 2px solid var(--accent); background: var(--white); border-radius: 10px; padding: 12px 14px;
  margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.note p { margin: 0; }
.inline-form { display: inline; margin: 0; }

/* The list: a table on a wide screen, one block per client on a phone. */
.clients-counts { font-size: 13px; }
table.clients { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; margin-top: 6px; }
table.clients th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--muted); padding: 8px 12px; border-bottom: 2px solid var(--line); }
table.clients td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.clients tr:last-child td { border-bottom: 0; }
table.clients .c-name { font-weight: 600; }
table.clients .c-action { text-align: right; width: 1%; white-space: nowrap; }
tr[data-chip="removed"] .c-name { color: var(--muted); font-weight: 500; }

/* Chips: solid little blocks, one per client. */
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px; font-size: 13px;
  font-weight: 700; line-height: 1.4; border: 2px solid transparent; box-shadow: 0 2px 0 rgba(0, 0, 0, .14);
  white-space: nowrap; }
.chip-invited { background: var(--white); color: var(--ink); border-color: var(--line); }
.chip-joined { background: var(--accent); color: var(--accent-ink, var(--ink)); }
.chip-removed { background: var(--paper); color: var(--muted); border-color: var(--line); box-shadow: none; }

.clients-empty { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; }

/* The advisor terms, shown once before the tab opens. */
.clients-terms { max-width: 720px; }
.draft-mark { display: inline-block; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 6px;
  background: #fff6d6; color: #6b4e00; border: 2px solid #f0d47a; }
.terms-list { margin: 14px 0 12px; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; }
.sample-banner { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; border: 2px dashed var(--brand-2);
  background: var(--white); font-size: 14px; }

@media (max-width: 640px) {
  .clients-panel { padding: 14px; gap: 22px; }
  .invite-card { padding: 14px; }
  .invite-form .field-row { grid-template-columns: 1fr; }
  .invite-form .btn { justify-self: stretch; justify-content: center; }
  table.clients thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.clients, table.clients tbody, table.clients tr, table.clients td { display: block; width: auto; }
  table.clients tr { border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px;
    background: var(--white); }
  table.clients td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; }
  table.clients td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; }
  table.clients .c-name { font-size: 16px; }
  table.clients .c-name::before { display: none; }
  table.clients .c-action { text-align: left; width: auto; padding-top: 8px; }
  table.clients .c-action:empty { display: none; }
  table.clients td[data-label="Joined"]:empty { display: none; }
}

/* Dark: tokens from the skin (inline style); the few fixed colors app.css and account.css use. */
@media (prefers-color-scheme: dark) {
  body.clients-page .top { background: rgba(15, 22, 19, .92); }
  body.clients-page .brand .mark { background: var(--mark-tile, var(--mint)); }
  body.clients-page .help-bubble .help-mark svg path, body.clients-page .help-bubble .help-mark svg circle,
  body.clients-page .help-face .help-mark svg path, body.clients-page .help-face .help-mark svg circle { stroke: #ffffff; }
  body.clients-page .help-head, body.clients-page .help-close { color: #ffffff; }
  body.clients-page .btn, body.clients-page .tab[aria-current="page"] { color: #ffffff; }
  body.clients-page .btn:hover { color: #ffffff; }
  body.clients-page .field input[type="text"], body.clients-page .field input[type="email"] { border-color: #3a4c45; }
  body.clients-page .status { border-color: #2f5a3e; }
  body.clients-page .status.error { background: #3a1a15; border-color: #6e2c22; color: #ffd9d2; }
  body.clients-page .field-error { color: #ffb4a6; }
  body.clients-page .draft-mark { background: #3a3012; color: #ffe08a; border-color: #6d5a1c; }
  body.clients-page .chip { box-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
  body.clients-page .help-panel, body.clients-page .help-list button { color: var(--ink); }
  body.clients-page .help-list button { background: var(--paper); border-color: var(--line); }
  body.clients-page main button:not(.btn), body.clients-page .top button {
    color: var(--ink); background: var(--white); border-color: var(--line); }
  body.clients-page main .btn { background: var(--brand); border-color: var(--brand); color: #ffffff; }
  body.clients-page main button[disabled] { opacity: .6; }
}
