/* Phase 2 area F1 styles — owned by agent F1. Shell: rail additions, popovers, live ticker. */

:root { --ork-accent: #4A3F7A; }

/* [hidden] must win over the rail's display:flex rules */
.rail-btn[hidden], .ork-ws-btn[hidden], .ork-live-btn[hidden], .ork-pop[hidden], .ork-confirm-scrim[hidden] { display: none !important; }

/* F7's admin view: shown by goView('admin'); the section itself ships with F7 */
.app[data-view="admin"] .view-admin { display: flex; }

/* The popover layer sits inside the .app grid: keep it out of the grid flow */
#orkShellLayer { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 10050; }

/* ── rail: workspace mark ─────────────────────────────────────────────────── */
.rail-header { padding-bottom: 12px; }
.ork-ws-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0 0 12px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.ork-brand-mark { cursor: default; }
.ork-ws-btn:focus-visible, .ork-live-btn:focus-visible, .rail-avatar:focus-visible { outline: 2px solid var(--ork-accent); outline-offset: 2px; }
.ork-ws-mark { position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ork-accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; overflow: hidden; }
.ork-ws-mark img { width: 100%; height: 100%; object-fit: cover; background: #fff; }

/* active rail item picks up the tenant accent */
.rail-btn.active { color: var(--ork-accent); }
.app[data-theme="dark"] .rail-btn.active { color: var(--sidebar-icon-active); }

/* ── rail: live / synced indicator ────────────────────────────────────────── */
.ork-live-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 44px; padding: 6px 0 5px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; }
.ork-live-btn:hover, .ork-live-btn.is-open { background: var(--sidebar-bg-hover); }
.ork-live-txt { font-size: 10px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ork-live-dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--success-500); box-shadow: 0 0 0 3px var(--success-50); }
.ork-live-btn.is-frozen .ork-live-dot { background: var(--neutral-500); box-shadow: 0 0 0 3px var(--neutral-200); }
.ork-live-btn.is-pulse .ork-live-dot::after { content: ''; position: absolute; inset: -2px; border-radius: 999px; border: 2px solid var(--success-500); animation: ork-pulse 1.4s ease-out 2; }
@keyframes ork-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }

/* ── rail: avatar as a button ─────────────────────────────────────────────── */
button.rail-avatar { padding: 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; background: #FCCEEE; color: #6F1A46; }
button.rail-avatar.is-open { box-shadow: 0 0 0 3px var(--brand-100); }

/* ── popovers ─────────────────────────────────────────────────────────────── */
.ork-pop { position: fixed; z-index: 10050; width: 300px; max-height: calc(100vh - 24px); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(16,24,40,.16); padding: 6px; font-size: 13px; }
.ork-pop-head { padding: 8px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.ork-pop-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.ork-pop-empty { padding: 14px 10px; color: var(--text-3); font-size: 12px; }
.ork-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ork-pop-item:hover, .ork-pop-item:focus-visible { background: var(--surface-2); outline: none; }
.ork-pop-item svg { color: var(--text-2); flex: none; }
.ork-pop-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 15px; flex: none; }
.ork-pop-count { margin-left: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* workspace list */
.ork-ws-menu { width: 320px; }
.ork-ws-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ork-ws-item:hover, .ork-ws-item:focus-visible { background: var(--surface-2); outline: none; }
.ork-ws-item.is-current { background: var(--brand-50); }
.ork-ws-item[disabled] { opacity: .55; cursor: default; }
.ork-ws-item.is-loading { opacity: .7; cursor: progress; }
.ork-ws-item-mark { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.ork-ws-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ork-ws-item-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ork-ws-item-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ork-ws-check { color: var(--ork-accent); flex: none; }
.app[data-theme="dark"] .ork-ws-check { color: var(--text); }

/* user menu */
.ork-user-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.ork-user-av { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; background: #FCCEEE; color: #6F1A46; font-size: 12px; font-weight: 700; flex: none; }
.ork-user-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ork-user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ork-user-email { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ork-role { flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--neutral-200); color: var(--text-2); }
.ork-role-admin { background: var(--brand-100); color: var(--brand-700); }
.ork-role-sales { background: var(--info-50); color: var(--info-600); }
.app[data-theme="dark"] .ork-role-admin { color: var(--text); }
.ork-pref { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; }
.ork-pref-col { flex-wrap: wrap; }
.ork-pref-lbl { color: var(--text-2); font-size: 12px; }
.ork-pref-hint { flex-basis: 100%; font-size: 11.5px; line-height: 1.4; color: var(--text-3); }
.ork-seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--neutral-200); gap: 2px; }
.ork-seg-opt { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.ork-seg-opt.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.1); font-weight: 600; }
.ork-seg-opt:focus-visible { outline: 2px solid var(--ork-accent); outline-offset: 1px; }

/* live panel */
.ork-live-panel { width: 360px; padding: 0; }
.ork-live-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 4px; }
.ork-live-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ork-live-sync { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ork-live-next { padding: 0 14px 10px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--border); }
.ork-feed { padding: 6px; max-height: 420px; overflow: auto; }
.ork-feed-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; width: 100%; padding: 9px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ork-feed-item:hover, .ork-feed-item:focus-visible { background: var(--surface-2); outline: none; }
.ork-feed-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ork-feed-title { font-weight: 500; line-height: 1.35; }
.ork-feed-detail { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.ork-feed-time { font-size: 11px; color: var(--text-3); white-space: nowrap; padding-top: 2px; }
.ork-sev { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-top: 5px; background: var(--info-600); }
.ork-sev.is-high { background: var(--error-500); }
.ork-sev.is-med { background: var(--warning-500); }
.ork-sev.is-action { background: var(--ork-accent); }

/* ticker toasts (bottom right) */
.ork-ticker { position: fixed; right: 20px; bottom: 20px; z-index: 10040; display: flex; flex-direction: column-reverse; gap: 8px; width: 340px; max-width: calc(100vw - 100px); pointer-events: none; }
.ork-tick { position: relative; display: grid; grid-template-columns: 10px 1fr 20px; gap: 10px; align-items: start; padding: 11px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--info-600); border-radius: 10px; box-shadow: 0 10px 28px rgba(16,24,40,.14); pointer-events: auto; animation: ork-tick-in .22s ease; transition: opacity .25s, transform .25s; }
.ork-tick.is-high { border-left-color: var(--error-500); }
.ork-tick.is-med { border-left-color: var(--warning-500); }
.ork-tick.is-leaving { opacity: 0; transform: translateY(6px); }
.ork-tick-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ork-tick-kicker { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.ork-tick-title { font-weight: 600; line-height: 1.35; }
.ork-tick-detail { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.ork-tick-close { border: 0; background: none; color: var(--text-3); font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
@keyframes ork-tick-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* confirm dialog */
.ork-confirm-scrim { position: fixed; inset: 0; z-index: 10060; display: flex; align-items: center; justify-content: center; background: rgba(16,24,40,.42); padding: 16px; }
.ork-confirm { width: 100%; max-width: 400px; background: var(--surface); color: var(--text); border-radius: 12px; padding: 20px 20px 16px; box-shadow: 0 20px 48px rgba(16,24,40,.24); }
.ork-confirm-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.ork-confirm-body { color: var(--text-2); line-height: 1.5; }
.ork-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ork-btn { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.ork-btn-danger { background: var(--error-500); border-color: var(--error-500); color: #fff; }
.ork-btn:disabled { opacity: .7; cursor: progress; }
.ork-btn:focus-visible { outline: 2px solid var(--ork-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .ork-live-btn.is-pulse .ork-live-dot::after, .ork-tick { animation: none; }
}
