/* css/r14-settings.css — SP1: SaaS shell (account menu + Settings view).
   Colors ONLY via La Carta tokens (--surface/--ink/--line/--gold-on-surface…).
   Loaded LAST in the <link> block (see tests/unit/link-order.test.js). */

/* In Settings, hide the header's contextual toolbars (hub/workspace);
   the account menu (.acct-menu) does NOT carry those classes → stays visible. */
body.bbp-settings-open .tb-ws,
body.bbp-settings-open .tb-hub { display: none !important; }

#settings-view { max-width: 920px; margin: 0 auto; padding: 24px 20px 64px; }
.settings-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.settings-title { font-size: 22px; font-weight: 600; color: var(--ink); margin: 0; }
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
@media (max-width: 720px){ .settings-layout { grid-template-columns: 1fr; } }

.settings-tabs { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 720px){ .settings-tabs { flex-direction: row; flex-wrap: wrap; } }
.settings-tab {
  text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text2); font-size: 14px; cursor: pointer;
}
.settings-tab:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.settings-tab.active { color: var(--gold-on-surface); border-color: var(--line); background: var(--surface); }
.settings-tab:focus-visible { outline: 2px solid var(--gold-on-surface); outline-offset: 2px; }

.settings-body { min-height: 240px; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.settings-id { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.settings-avatar {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 600; color: var(--gold-on-surface);
  background: color-mix(in srgb, var(--gold-on-surface) 14%, transparent); border: 1px solid var(--line);
}
.settings-id-mail { font-size: 15px; color: var(--ink); font-weight: 500; }
.settings-id-note { font-size: 12px; color: var(--text3); }
.settings-subt { font-size: 13px; font-weight: 600; color: var(--ink); margin: 4px 0 8px; }
.settings-sep { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.settings-hint { font-size: 13px; color: var(--text3); }
.settings-msg { font-size: 12px; margin-top: 8px; min-height: 16px; }
.settings-msg.ok { color: var(--ok-on-surface); }
.settings-msg.err { color: var(--danger-on-surface); }

/* Account menu (header) — hydrated by ext-account.js (Task 3). */
.acct-menu { position: relative; display: inline-flex; }
.acct-trigger { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.acct-avatar {
  width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 600; color: var(--gold-on-surface);
  background: color-mix(in srgb, var(--gold-on-surface) 16%, transparent);
}
.acct-role {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px;
}
.acct-role:empty { display: none; }
.acct-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid var(--text3); }
.acct-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);   /* standard elevation; if the impeccable detector flags it, promote to a --shadow token */
}
.acct-dropdown[hidden] { display: none; }
.acct-idcard { padding: 6px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-name { display: block; font-weight: 600; color: var(--ink); font-size: 14px; }
.acct-name:empty { display: none; }
.acct-mail { display: block; font-size: 12px; color: var(--text3); }
.acct-role-line { display: block; font-size: 11px; color: var(--text3); margin-top: 2px; }
.acct-role-line:empty { display: none; }
.acct-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 8px; border: none; background: transparent; color: var(--ink);
  font-size: 14px; border-radius: 6px; cursor: pointer;
}
.acct-item:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.acct-item:focus-visible { outline: 2px solid var(--gold-on-surface); outline-offset: -2px; }

/* SP3 · pestaña Empresa — logo preview + read-only note. Colors via tokens only. */
.brand-logo-preview {
  margin: 8px 0; min-height: 8px;
}
.brand-logo-preview:not(:empty) {
  width: 120px; height: 120px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px;
}
.brand-logo-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* The shared .brand-logo-img only self-constrains inside a box with definite
   dimensions (the 120×120 preview above). In the header bar and the login card
   the container is text-sized with no definite height, so max-*:100% resolves
   against an indefinite containing block → no constraint → the raster paints at
   its natural size (up to 512px) and blows out the layout. Bound it per surface. */
.header .logo .brand-logo-img { display: inline-block; vertical-align: middle; height: 30px; width: auto; max-width: 200px; }
.auth-logo .brand-logo-img { display: block; margin: 0 auto; height: auto; max-height: 60px; max-width: 240px; }

/* SP2 · pestaña Equipo */
.team-list, .team-invites { display: flex; flex-direction: column; gap: 8px; }
.team-row, .team-invite-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child, .team-invite-row:last-child { border-bottom: 0; }
.team-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--gold-on-surface); font-weight: 600; flex: 0 0 auto; }
.team-id { flex: 1 1 auto; min-width: 0; }
.team-mail { color: var(--ink-soft, var(--ink)); opacity: .7; font-size: 13px; }
.team-you { color: var(--gold-on-surface); font-size: 12px; }
.team-role-chip { font-size: 13px; color: var(--gold-on-surface); }
.team-role { padding: 4px 6px; }
