/* B-side Settings — app-specific layout only. Shared tokens/components live
   in tokens.css / components.css (identical across all 4 B-side apps). */

.nav-brand-mark { height: 32px; width: auto; flex: none; display: block; }

/* ---- notification bell (nav) ---- */
.notif-popover-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -2px; right: -2px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--accent-700); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
}
.notif-popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 300px; max-height: 360px;
  overflow-y: auto; background: var(--surface); border: var(--border-rule) solid var(--ink-200);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--space-2);
}
/* Users table: optional account name shown above the email. */
.user-name { display: block; font-weight: 600; color: var(--ink); }
/* Edit user > Erase account (right to erasure); its confirmation text uses blank lines. */
.dialog-backdrop .dialog p { white-space: pre-line; }
.erase-zone { border-top: 1px dashed var(--ink-200); padding-top: var(--space-3); margin-top: var(--space-2); }
.btn-erase { color: var(--danger-700); border: var(--border-rule) solid var(--danger); background: transparent; align-self: flex-start; }
.btn-erase:hover { background: var(--danger); color: #fff; }
.tag-danger { background: transparent; color: var(--danger-700); border-color: var(--danger); }
.field-optional { font-weight: 400; color: var(--ink-500); }
.notif-empty { font-size: 13px; color: var(--ink-600); padding: var(--space-4) var(--space-3); text-align: center; }

/* ---- auth screens (sign-in / access denied) ---- */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: var(--space-5);
}
.auth-card { padding: var(--space-6) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.auth-logo { height: 32px; width: auto; display: block; }
.auth-card h1 { font-size: 22px; }
.auth-sub { font-size: 13px; color: var(--ink-600); margin-bottom: var(--space-2); }
.auth-card form { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-2); }
.auth-card form[hidden] { display: none; }
/* Quiet grey text link under a form's main button ("Forgot password?", "Back to sign in"). */
.auth-link {
  align-self: center; margin-top: calc(-1 * var(--space-2)); padding: 4px 6px; border: 0; background: none;
  color: var(--ink-500); font: inherit; font-size: 13px; cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
}
.auth-link:hover, .auth-link:focus-visible { color: var(--ink-700); text-decoration-color: currentColor; }
.denied-view p, #denied-view p { margin-top: var(--space-2); font-size: 14px; color: var(--ink-600); }

.search-icon { position: absolute; right: 12px; width: 16px; height: 16px; color: var(--ink-500); pointer-events: none; display: flex; }
.search-icon svg { width: 100%; height: 100%; }

/* ---- app content ---- */
.app-content { max-width: 1080px; margin: 0 auto; padding: var(--space-6) var(--space-5) var(--space-8); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.section-head h2 { font-size: 22px; }

.table-toolbar { padding: 0 0 var(--space-4); border-bottom: none; background: transparent; }
.field-search { max-width: 320px; }

/* ---- per-user access history (popover + modal) ---- */
.access-cell { display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; }

.access-popover {
  position: fixed; z-index: 300; width: 270px;
  background: var(--surface); border: 1px solid var(--ink-300); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3);
}
.access-popover h4 {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-500); margin: 0 0 var(--space-2);
}
.access-popover ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.access-popover li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font-size: 12.5px; }
.access-popover .app-name { color: var(--ink); }
.access-popover .app-when { color: var(--ink-600); text-align: right; white-space: nowrap; }
.access-popover .app-when.is-muted { color: var(--ink-500); font-style: italic; }

/* ---- document style preferences ---- */
.style-pref-card {
  background: var(--surface);
  border: var(--border-rule) solid var(--ink-200);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
  overflow: hidden;
}
.style-pref-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
  color: inherit;
}
.style-pref-header:hover {
  background: var(--ink-50);
}
.style-pref-header-text {
  flex: 1;
  min-width: 0;
}
.style-pref-dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
}
.style-pref-chevron {
  flex: none;
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.style-pref-chevron svg {
  width: 20px;
  height: 20px;
}
.style-pref-header h3 {
  font-size: 16px;
  margin: 0;
  color: var(--ink-900);
  font-weight: 600;
}
.style-pref-desc {
  font-size: 13px;
  color: var(--ink-600);
  margin: 2px 0 0 0;
}
.style-pref-content {
  padding: 0 var(--space-4) var(--space-4) var(--space-4);
}
.style-pref-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); flex-wrap: wrap;
}
.style-pref-status { font-size: 13px; font-weight: 600; min-height: 20px; }
.style-pref-buttons { display: flex; gap: var(--space-2); }
.style-input { resize: vertical; min-height: 80px; }
.style-pref-card:has(.style-input:not(:placeholder-shown)) .btn-primary:not(:disabled) {
  animation: none;
}
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 720px) {
  .auth-shell { padding: 16px; }
  .app-content { padding-left: 16px; padding-right: 16px; }
  .style-pref-header { padding: var(--space-3); }
  .style-pref-content { padding: 0 var(--space-3) var(--space-3) var(--space-3); }
  .section-head { gap: var(--space-2); margin-bottom: var(--space-4); }
  .section-head h2 { font-size: 20px; }
  .section-head .btn { white-space: nowrap; }
}

/* Month picker inside the "Spend by app" heading (Cost tab). */
.app-usage-month { width: auto; height: 28px; padding: 0 8px; font-size: 12.5px; margin-left: var(--space-2); vertical-align: middle; }

/* ---------- AI Models ---------- */
/* One section per app; on a PC all of an app's model cards sit side by side in one row
   (--ai-cols = how many models that app offers), 2 per row on tablets, stacked on phones. */
.ai-app { margin-top: var(--space-6); }
.ai-app h3 { margin: 0 0 var(--space-1); }
.ai-app-task { margin: 0 0 var(--space-3); color: var(--ink-600); font-size: 13.5px; max-width: 80ch; }
.ai-app > .field-help { margin-top: var(--space-2); }
.ai-model-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(var(--ai-cols, 4), minmax(0, 1fr)); }
@media (max-width: 1000px) { .ai-model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ai-model-grid { grid-template-columns: 1fr; } }
.ai-model-card.is-current { border-color: var(--accent-500); }
.ai-model-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ai-model-head h4 { margin: 0; font-size: 15px; }
.ai-model-stars { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); margin: 0; font-size: 13px; }
.ai-model-stars dt { color: var(--ink-600); }
.ai-model-stars dd { margin: 0; white-space: nowrap; }
.ai-stars { color: var(--accent-600); letter-spacing: 2px; }
.ai-stars-off { color: var(--ink-300); }
.ai-model-note { margin: 0; font-size: 13px; flex: 1; }
.ai-model-card .btn { align-self: flex-start; }
