/* The shell's account row and menu, the notification bell's dropdown, and
 * Ajustes (/settings). Prefixes: acct- (row, menu), bell-/ntf- (bell,
 * dropdown), set- (Ajustes). Sizes are Flutter's logical px; the 90% zoom
 * of app.css applies to all of them. */

/* ── Account row (ShellAccountButton) ─────────────────────────────────── */

.acct-wrap { flex: none; }
.acct-avatars.is-solo { width: 30px; }
.acct.is-pending { cursor: default; }
.acct.is-pending:hover { background: none; }
.acct-org.sk { background-color: transparent; }
.acct-user .sk { background-color: transparent; }
.acct:focus-visible, .menu-item:focus-visible, .ntf-row:focus-visible, .ntf-all:focus-visible,
.set-lang:focus-visible {
  outline: 2px solid var(--primary); outline-offset: -2px;
}

/* The menu (PopupMenuButton): header item, then 40px rows. */
.acct-menu { transform-origin: bottom left; }
.acct-menu-who { min-width: 0; flex: 1; }
.acct-menu-who b, .acct-menu-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-theme { display: flex; align-items: center; gap: 12px; }
.acct-theme .ic { color: var(--text-2); }
.menu-item:focus { outline: none; }
.menu-item:focus-visible { background: var(--hover); }
.menu-item.is-disabled { color: var(--muted); cursor: default; }
.menu-item.is-disabled .ic { color: var(--muted); }
.menu-item.is-disabled:hover { background: none; }

/* ── Bell (ShellNotificationButton) ───────────────────────────────────── */

.bell .bell-on, .bell .bell-off { display: grid; }
.bell .bell-on { display: none; color: var(--primary); }
.bell.has-unread .bell-on { display: grid; }
.bell.has-unread .bell-off { display: none; }
.bell:not(.has-unread) .bell-badge { display: none; }
/* Pressed look while open: the selected fill, 4px in, radius 10. */
.bell::before { content: ""; position: absolute; inset: 4px; border-radius: 10px; background: transparent; transition: background-color 120ms linear; pointer-events: none; }
.bell.is-open::before { background: var(--selected); }
.bell.is-open:hover { background: none; }
.bell.is-open::after { display: none; }
.bell .bell-on, .bell .bell-off { position: relative; }

/* The dropdown: 320 wide, radius 6, no padding, under the bell. */
.ntf-pop { width: 320px; min-width: 320px; padding: 0; border-radius: 6px; transform-origin: top right; overflow: hidden; }
.ntf-body { max-height: calc(100dvh / var(--zoom) - 80px); overflow-y: auto; scrollbar-width: thin; }
.ntf-head { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 12px; }
.ntf-head b { font-size: 13px; font-weight: 600; color: var(--text); }
.ntf-all { font-size: 11px; color: var(--primary); letter-spacing: .25px; border-radius: 4px; }
.ntf-all:hover { text-decoration: underline; }
.ntf-sep { height: 1px; background: var(--border); }
.ntf-list { padding: 0 0 8px; }
.ntf-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 12px; text-align: left; }
.ntf-row:hover, .ntf-row:focus-visible { background: var(--hover); }
.ntf-row:focus { outline: none; }
.ntf-kind { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.ntf-kind.is-info { color: var(--primary); background: color-mix(in srgb, var(--primary) 20%, transparent); }
.ntf-kind.is-warning { color: var(--warning); background: color-mix(in srgb, var(--warning) 20%, transparent); }
.ntf-kind.is-error { color: var(--error); background: color-mix(in srgb, var(--error) 20%, transparent); }
/* Flutter draws success white on 20% white: invisible on a light card.
   Light uses the success green; dark keeps Flutter's white. */
.ntf-kind.is-success { color: var(--success); background: color-mix(in srgb, var(--success) 20%, transparent); }
:root[data-theme="dark"] .ntf-kind.is-success { color: #fff; background: rgba(255, 255, 255, .2); }
.ntf-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.ntf-msg { font-size: 12px; line-height: 1.33; color: var(--text); letter-spacing: .1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ntf-row.is-unread .ntf-msg { font-weight: 500; }
.ntf-ago { margin-top: 2px; font-size: 10px; line-height: 1.2; color: var(--muted); }
.ntf-dot { flex: none; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--primary); }
.ntf-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 64px; padding: 12px; color: var(--muted); font-size: 12px; text-align: center; }
.ntf-empty small { font-size: 11px; }

/* ── Ajustes (SettingsScreen) ─────────────────────────────────────────── */

/* SettingsScreen pads its own scroll view by 32 from the content's edge,
   with no extra inset (Flutter's capture: cards at 212 + 32). */
.page.set-page { padding: 28px 32px 40px; left: 0; }
.set-col { max-width: 960px; display: flex; flex-direction: column; gap: 28px; }
.set-group { display: flex; flex-direction: column; gap: 12px; }
.set-group-title { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.set-card {
  display: flex; flex-direction: column; gap: 16px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.set-card.set-sk { min-height: 132px; }
.set-head { display: flex; gap: 12px; align-items: flex-start; }
.set-chip {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 10%, var(--card)); color: var(--primary);
}
.set-chip.is-claude { background: color-mix(in srgb, #d97757 16%, var(--card)); color: #c15f3c; }
.set-title { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); }
.set-sub { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.set-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* Language: two tiles, the picked one outlined with its check. */
.set-langs { display: flex; gap: 10px; margin-top: auto; }
.set-lang {
  flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; text-align: left; cursor: pointer;
  transition: background-color 100ms linear, border-color 100ms linear;
}
.set-lang:hover { background: var(--hover); }
.set-lang.is-on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: color-mix(in srgb, var(--primary) 5%, var(--card)); cursor: default; }
.set-flag { font-size: 22px; line-height: 1.2; letter-spacing: 0; }
.set-lang-label { flex: 1; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-lang.is-on .set-lang-label { font-weight: 600; }
.set-check { color: var(--primary); display: none; }
.set-lang.is-on .set-check, .set-theme .set-check { display: inline-grid; }

/* Theme: a small picture of the app in each mode. */
.set-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.set-theme {
  display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--border);
  background: transparent; cursor: pointer; transition: border-color 100ms linear;
}
.set-theme:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.set-theme.is-on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.set-theme-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 2px; font-size: 13px; font-weight: 500; color: var(--text); }
.set-theme-pic {
  --pg: #f4f2ee; --pc: #ffffff; --ps: #ffffff; --pl: #d9d6d0; --pa: #1976d2;
  position: relative; display: block; height: 64px; border-radius: 8px; overflow: hidden; background: var(--pg);
  border: 1px solid rgba(0, 0, 0, .08);
}
.set-theme-pic.is-dark { --pg: #1f1f1e; --pc: #2a2a29; --ps: #252524; --pl: #3a3a38; --pa: #3987e5; border-color: rgba(255, 255, 255, .08); }
.set-theme-pic.is-system { background: linear-gradient(135deg, #f4f2ee 50%, #1f1f1e 50%); }
.set-theme-pic i { position: absolute; display: block; border-radius: 3px; }
.set-theme-pic .tp-side { left: 0; top: 0; bottom: 0; width: 22%; border-radius: 0; background: var(--ps); border-right: 1px solid var(--pl); }
.set-theme-pic .tp-bar { left: 28%; top: 10px; width: 34%; height: 6px; background: var(--pa); }
.set-theme-pic .tp-card { left: 28%; top: 24px; width: 30%; height: 30px; background: var(--pc); border: 1px solid var(--pl); }
.set-theme-pic .tp-card.is-b { left: 62%; width: 30%; }
.set-theme-pic.is-system .tp-side { background: #ffffff; border-color: #d9d6d0; }
.set-theme-pic.is-system .tp-card { background: #ffffff; border-color: #d9d6d0; }
.set-theme-pic.is-system .tp-card.is-b { background: #2a2a29; border-color: #3a3a38; }

/* Claude: its state, what it can do, how to connect it. */
.set-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-light, var(--hover));
}
.set-pill.is-on { color: var(--success, #2e7d32); background: color-mix(in srgb, var(--success, #2e7d32) 12%, var(--card)); }
.set-pill.is-on i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.set-can { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.set-can li {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.4;
  color: var(--text-2); background: var(--surface-light, var(--hover));
}
.set-can .ic { flex: none; margin-top: 1px; color: var(--primary); }
.set-foot { display: flex; justify-content: flex-end; }
.set-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.set-url { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 4px 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); max-width: 100%; }
.set-url code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text); }
.set-copy { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--text-2); }
.set-copy:hover { background: var(--hover); color: var(--text); }

/* Help: one row per thing, its button at the end. */
.set-list { gap: 0; padding: 4px 20px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.set-row + .set-row { border-top: 1px solid var(--border); }
.set-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.set-row-text b { font-size: 14px; font-weight: 600; color: var(--text); }
.set-outline {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.set-outline:hover { background: var(--hover); }
.set-outline[disabled] { opacity: .45; cursor: default; background: none; }
.set-outline.is-danger { color: var(--error, #d32f2f); }
.set-outline.is-danger:hover { border-color: color-mix(in srgb, var(--error, #d32f2f) 45%, var(--border)); background: color-mix(in srgb, var(--error, #d32f2f) 6%, var(--card)); }
.set-theme:focus-visible, .set-copy:focus-visible, .set-outline:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 900px) {
  .set-grid { grid-template-columns: 1fr; }
  .set-can { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .page.set-page { padding: 20px 16px 32px; }
  .set-row { flex-wrap: wrap; }
  .set-row .set-outline { width: 100%; justify-content: center; min-height: 44px; }
  .set-lang, .set-theme { min-height: 44px; }
  .set-copy { width: 44px; height: 44px; }
}

/* ── Super-admin acting on an org (SuperAdminSidebarButton) ────────────── */

.sa-side { position: relative; flex: none; padding: 4px 8px; }
.sa-side-full {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px;
  background: var(--error); color: #fff; border-radius: 8px;
}
.sa-side-ic { display: grid; flex: none; }
.sa-side-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sa-side-text small { font-size: 9px; font-weight: 700; letter-spacing: .8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-side-text b { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-side-exit { flex: none; height: 28px; padding: 0 8px; border-radius: 4px; background: rgba(255, 255, 255, .15); color: #fff; font-size: 11px; }
.sa-side-exit:hover { background: rgba(255, 255, 255, .25); }
.sa-side-mini { display: none; place-items: center; width: 40px; height: 36px; border-radius: 8px; background: var(--error); color: #fff; }
.app-shell.is-collapsed .sa-side { padding: 4px 11px 4px 12px; }
.app-shell.is-collapsed .sa-side-full { display: none; }
.app-shell.is-collapsed .sa-side-mini { display: grid; }
.sa-side-menu {
  position: absolute; left: 12px; bottom: calc(100% + 4px); z-index: var(--z-menu); min-width: 220px; padding: 8px 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--menu-shadow);
}
.acct-acting { padding: 4px 12px 6px; font-size: 11px; color: var(--error); font-weight: 600; letter-spacing: .25px; }
.acct-acting b { color: var(--text); }
.acct-exit, .acct-exit .ic { color: var(--error); }

/* The banner inside a suspended org the super-admin entered. */
.sa-suspended {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 20px;
  background: color-mix(in srgb, var(--error) 12%, var(--surface)); color: var(--error);
  border-bottom: 1px solid color-mix(in srgb, var(--error) 30%, transparent); font-size: 13px;
}
.sa-suspended a { text-decoration: underline; font-weight: 600; }

/* ── The activity feed (shell/_activity_feed.html): Inicio and Ciclo S&OP ─ */

.afeed-list { margin: 8px 0 0; padding: 0; list-style: none; }
.afeed-row { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 7px 8px; border-radius: 6px; color: var(--text); }
.afeed-row:hover, .afeed-row:focus-visible { background: var(--hover); }
.afeed-text { font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.afeed-text b { font-weight: 600; }
.afeed-ago { font-size: 11px; color: var(--muted); }
.afeed-empty { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.sop-card.afeed { margin-top: 14px; padding: 16px 18px 14px; }
/* The narrow cycle card: a row's -8px bleed sat under the list's own
   scroller and cut the first letters ("nline · Snacks salados"); there the
   row keeps inside the card and its sentence wraps in full. */
.sop-card.afeed .afeed-row { margin: 0; padding: 7px 6px; }
.sop-card.afeed .afeed-text { display: block; overflow: visible; -webkit-line-clamp: unset; overflow-wrap: anywhere; }
.afeed-all { margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--primary); }
.afeed-all:hover { text-decoration: underline; }
