/* ============================================
   Settings + Teams (Profile, Notifications, Billing, Team Management, team invite pages)
   Neutral by design, same family as the Create New Event flow: ink, greys and white.
   Persona accents are not used here, so every persona sees the same pages.
   Every class is prefixed .st- and scoped under .st so nothing leaks into the app.
   ============================================ */

.st {
  --st-ink: var(--grey-900);
  --st-ink-2: var(--grey-700);
  --st-muted: var(--n-500);
  --st-faint: var(--n-400);
  --st-line: var(--n-200);
  --st-line-soft: var(--n-100);
  --st-line-strong: var(--n-300);
  --st-wash: var(--n-50);
  --st-fill: var(--n-100);
  --st-surface: #fff;
  --st-ok: var(--semantic-success, #10b981);
  --st-warn: var(--semantic-warning, #f59e0b);
  --st-danger: var(--semantic-danger, #ef4444);
  --st-shadow: 0 1px 2px rgba(9, 17, 59, .04), 0 1px 3px rgba(9, 17, 59, .04);
  --st-shadow-lift: 0 2px 4px rgba(9, 17, 59, .04), 0 8px 24px rgba(9, 17, 59, .07);

  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--st-ink);
  -webkit-font-smoothing: antialiased;
}
.st *, .st *::before, .st *::after { box-sizing: border-box; }
.st :where(button, input, textarea, select) { font: inherit; color: inherit; }
.st :where(h1, h2, h3, h4) { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; color: var(--st-ink); }
.st :where(p) { margin: 0; }
.st :focus-visible { outline: 2px solid var(--st-ink); outline-offset: 2px; }

/* ---- Page frame ---- */
.st-page { width: 100%; max-width: 880px; display: flex; flex-direction: column; gap: 20px; }
.st-page--narrow { max-width: 720px; }

/* ---- Page header: title + one-line description, optional actions on the right ---- */
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 4px; }
.st-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--st-faint); }
.st-title { font-family: var(--font-display); font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; color: var(--st-ink); }
.st-sub { font-size: 14px; color: var(--st-muted); }
.st-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- Back link (team sub-pages) ---- */
.st-back { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--st-muted); cursor: pointer; align-self: flex-start; }
.st-back:hover { color: var(--st-ink); }

/* ---- Card: one titled section ---- */
.st-card { background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 14px; box-shadow: var(--st-shadow); overflow: hidden; }
.st-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--st-line-soft); }
.st-card-head-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-card-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--st-ink); }
.st-card-desc { font-size: 13px; line-height: 1.5; color: var(--st-muted); max-width: 560px; }
.st-card-body { padding: 20px 24px 24px; }
.st-card-body--flush { padding: 0; }
.st-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: var(--st-wash); border-top: 1px solid var(--st-line-soft); }
.st-card--danger { border-color: color-mix(in srgb, var(--st-danger) 28%, var(--st-line)); }
.st-card--danger .st-card-title { color: color-mix(in srgb, var(--st-danger) 80%, black); }

/* Clickable card (team list rows) */
.st-card--link { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 20px; text-align: left; cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease; }
.st-card--link:hover { box-shadow: var(--st-shadow-lift); border-color: var(--st-line-strong); }

/* ---- Rows: label + description on the left, value or control on the right ---- */
.st-rows { display: flex; flex-direction: column; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-top: 1px solid var(--st-line-soft); }
.st-rows > .st-row:first-child { border-top: none; }
.st-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-row-label { font-size: 14px; font-weight: 600; color: var(--st-ink); }
.st-row-desc { font-size: 13px; color: var(--st-muted); }
.st-row-value { font-size: 14px; color: var(--st-ink-2); overflow-wrap: anywhere; }
.st-row-value--empty { color: var(--st-faint); }
.st-row-end { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Two-column field grid (profile details) */
.st-fields { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .st-fields { grid-template-columns: 1fr 1fr; } .st-fields > .st-field:nth-child(even) { border-left: 1px solid var(--st-line-soft); } }
.st-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--st-line-soft); min-width: 0; }
@media (min-width: 1024px) { .st-fields > .st-field:nth-child(-n+2) { border-top: none; } }
@media (max-width: 1023px) { .st-fields > .st-field:first-child { border-top: none; } }
.st-field-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-field-label { font-size: 12px; font-weight: 600; color: var(--st-muted); }

/* ---- Form controls ---- */
.st-label { display: block; font-size: 13px; font-weight: 600; color: var(--st-ink); margin-bottom: 6px; }
.st-help { font-size: 12px; color: var(--st-faint); margin-top: 6px; }
.st-input, .st-textarea, .st-select {
  width: 100%; padding: 10px 12px; font-size: 14px; color: var(--st-ink);
  background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.st-input::placeholder, .st-textarea::placeholder { color: var(--st-faint); }
.st-input:focus, .st-textarea:focus, .st-select:focus { outline: none; border-color: var(--st-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-ink) 10%, transparent); }
.st-input:disabled { background: var(--st-wash); color: var(--st-muted); }
.st-textarea { min-height: 96px; resize: vertical; }
.st-grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 1024px) { .st-grid-2 { grid-template-columns: 1fr 1fr; } }
.st-stack { display: flex; flex-direction: column; gap: 16px; }

/* ---- Buttons ---- */
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.st-btn:disabled, .st-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.st-btn--primary { background: var(--st-ink); color: #fff; }
.st-btn--primary:hover:not(:disabled) { background: var(--st-ink-2); }
.st-btn--secondary { background: var(--st-surface); color: var(--st-ink); border-color: var(--st-line); box-shadow: var(--st-shadow); }
.st-btn--secondary:hover:not(:disabled) { border-color: var(--st-line-strong); background: var(--st-wash); }
.st-btn--ghost { background: transparent; color: var(--st-muted); }
.st-btn--ghost:hover:not(:disabled) { color: var(--st-ink); background: var(--st-fill); }
.st-btn--danger { background: var(--st-surface); color: color-mix(in srgb, var(--st-danger) 85%, black); border-color: color-mix(in srgb, var(--st-danger) 30%, var(--st-line)); }
.st-btn--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--st-danger) 6%, white); }
.st-btn--danger-solid { background: var(--st-danger); color: #fff; }
.st-btn--danger-solid:hover:not(:disabled) { background: color-mix(in srgb, var(--st-danger) 85%, black); }
.st-btn--sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.st-btn--lg { padding: 12px 20px; font-size: 14px; }
.st-btn--block { width: 100%; }
.st-link { border: none; background: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--st-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--st-line-strong); cursor: pointer; }
.st-link:hover { text-decoration-color: var(--st-ink); }

/* ---- Badges ---- */
.st-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: 11px; font-weight: 700; line-height: 1.4; border-radius: 999px; background: var(--st-fill); color: var(--st-ink-2); white-space: nowrap; }
.st-badge--ink { background: var(--st-ink); color: #fff; }
.st-badge--outline { background: transparent; border: 1px solid var(--st-line); color: var(--st-muted); }
.st-badge--ok { background: color-mix(in srgb, var(--st-ok) 12%, white); color: color-mix(in srgb, var(--st-ok) 70%, black); }
.st-badge--warn { background: color-mix(in srgb, var(--st-warn) 14%, white); color: color-mix(in srgb, var(--st-warn) 60%, black); }
.st-badge--danger { background: color-mix(in srgb, var(--st-danger) 10%, white); color: color-mix(in srgb, var(--st-danger) 75%, black); }
.st-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ---- Notice / callout ---- */
.st-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--st-wash); border: 1px solid var(--st-line-soft); font-size: 13px; color: var(--st-ink-2); }
.st-note svg { flex-shrink: 0; margin-top: 1px; color: var(--st-muted); }
.st-note--warn { background: color-mix(in srgb, var(--st-warn) 8%, white); border-color: color-mix(in srgb, var(--st-warn) 25%, white); }
.st-note--danger { background: color-mix(in srgb, var(--st-danger) 6%, white); border-color: color-mix(in srgb, var(--st-danger) 20%, white); color: color-mix(in srgb, var(--st-danger) 75%, black); }

/* ---- Avatars + icon tiles ---- */
.st-avatar { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; background: var(--st-fill); color: var(--st-ink-2); font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.st-avatar img { width: 100%; height: 100%; object-fit: cover; }
.st-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.st-avatar--lg { width: 64px; height: 64px; font-size: 20px; }
.st-avatar--square { border-radius: 12px; }
.st-icon-tile { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--st-fill); color: var(--st-ink-2); }

/* ---- Tabs (team dashboard) ---- */
.st-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--st-line); overflow-x: auto; }
.st-tab { position: relative; padding: 10px 12px; border: none; background: none; font-size: 13px; font-weight: 600; color: var(--st-muted); cursor: pointer; white-space: nowrap; }
.st-tab:hover { color: var(--st-ink); }
.st-tab--active { color: var(--st-ink); }
.st-tab--active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--st-ink); }
.st-tab-count { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; background: var(--st-fill); color: var(--st-muted); }

/* ---- Table-like list (members, invitations) ---- */
.st-list { display: flex; flex-direction: column; }
.st-list-row { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-top: 1px solid var(--st-line-soft); }
.st-list > .st-list-row:first-child { border-top: none; }
.st-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.st-list-title { font-size: 14px; font-weight: 600; color: var(--st-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-list-sub { font-size: 12px; color: var(--st-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Stats (seats, usage) ---- */
.st-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.st-stat { padding: 16px 18px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface); }
.st-stat-label { font-size: 12px; font-weight: 600; color: var(--st-muted); }
.st-stat-value { margin-top: 4px; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--st-ink); }
.st-meter { height: 6px; border-radius: 999px; background: var(--st-fill); overflow: hidden; margin-top: 10px; }
.st-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--st-ink); }

/* ---- Empty state ---- */
.st-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; }
.st-empty .st-icon-tile { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 6px; }
.st-empty-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--st-ink); }
.st-empty-desc { font-size: 13px; color: var(--st-muted); max-width: 380px; }
.st-empty .st-btn { margin-top: 10px; }

/* ---- Spinner + skeleton ---- */
.st-spinner { width: 20px; height: 20px; border-radius: 999px; border: 2px solid var(--st-line); border-top-color: var(--st-ink); animation: st-spin .8s linear infinite; }
.st-skel { background: var(--st-fill); border-radius: 8px; animation: st-pulse 1.4s ease-in-out infinite; }
@keyframes st-spin { to { transform: rotate(360deg); } }
@keyframes st-pulse { 50% { opacity: .55; } }

/* ---- Standalone frame (team invite landing: full page, no app sidebar) ---- */
.st-standalone { min-height: 100vh; display: flex; flex-direction: column; background: var(--grey-25); }
.st-standalone-bar { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; }
.st-standalone-bar img { height: 26px; width: auto; display: block; }
.st-standalone-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 20px 64px; }
.st-standalone-card { width: 100%; max-width: 460px; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 20px; box-shadow: var(--st-shadow-lift); overflow: hidden; }
.st-standalone-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 36px 36px 24px; }
.st-standalone-body { padding: 0 36px 32px; display: flex; flex-direction: column; gap: 16px; }
.st-standalone-actions { display: flex; gap: 10px; }
.st-standalone-actions > .st-btn { flex: 1; }
.st-standalone-foot { padding: 14px 36px; background: var(--st-wash); border-top: 1px solid var(--st-line-soft); font-size: 12px; color: var(--st-muted); text-align: center; }
.st-status-icon { width: 52px; height: 52px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--st-fill); color: var(--st-ink); }
.st-status-icon--ok { background: color-mix(in srgb, var(--st-ok) 12%, white); color: color-mix(in srgb, var(--st-ok) 70%, black); }
.st-status-icon--warn { background: color-mix(in srgb, var(--st-warn) 14%, white); color: color-mix(in srgb, var(--st-warn) 60%, black); }
.st-status-icon--danger { background: color-mix(in srgb, var(--st-danger) 10%, white); color: color-mix(in srgb, var(--st-danger) 75%, black); }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .st-title { font-size: 22px; }
  .st-card-head, .st-card-body, .st-row, .st-field, .st-list-row { padding-left: 16px; padding-right: 16px; }
  .st-row { flex-direction: column; align-items: flex-start; }
  .st-standalone-hero, .st-standalone-body { padding-left: 22px; padding-right: 22px; }
  .st-standalone-actions { flex-direction: column-reverse; }
}
