/* Ocalt Business */
:root {
  --bg: #0b0d12;
  --panel: #12151c;
  --panel-2: #181c25;
  --line: #252a36;
  --text: #e8eaf0;
  --muted: #8a92a6;
  --accent: #5b8cff;
  --accent-2: #3d6fe8;
  --good: #3ccf91;
  --bad: #ff5d6c;
  --warn: #f2b84b;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }

/* waiting, signed out, offline */
.screen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); padding: 16px; z-index: 50; }
.screen-card { width: 100%; max-width: 400px; text-align: center; }
.screen-mark { width: 64px; height: 64px; margin-bottom: 18px; }
.screen-title { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.screen-text { color: var(--muted); margin-bottom: 20px; }
.screen-bar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.screen-bar span { display: block; width: 35%; height: 100%; background: var(--accent); border-radius: 3px; animation: slide 1.2s ease-in-out infinite; }
.screen.still .screen-bar { display: none; }
.screen-actions { margin-top: 18px; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #39404f; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:not(.ghost) { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.icon-btn { background: transparent; border: 0; color: var(--text); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--panel-2); }
input { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; width: 100%; }
input:focus { outline: none; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
.field { display: block; margin: 14px 0; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.seg { display: flex; gap: 18px; }
.seg label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.row-end { display: flex; justify-content: flex-end; margin-top: 18px; }

/* chrome */
.app { display: flex; flex-direction: column; height: 100%; }
.top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.brand img { width: 26px; height: 26px; }
.acting { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.me { display: flex; align-items: center; gap: 8px; }
.me-name { font-weight: 500; }
.tier { font-size: 12px; text-transform: capitalize; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 1px 9px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.chip.on { color: var(--good); border-color: rgba(60,207,145,.4); background: rgba(60,207,145,.08); }
.body { flex: 1; display: flex; min-height: 0; }
.side { width: 270px; flex: none; border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 14px 10px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted-head { margin-top: 18px; }
.side-item { display: block; padding: 9px 10px; border-radius: 9px; color: var(--text); }
.side-item:hover { background: var(--panel-2); }
.side-item.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.side-name { display: block; font-weight: 500; }
.side-meta { display: block; font-size: 12px; color: var(--muted); }
.side-empty { padding: 4px 10px 8px; font-size: 13px; color: var(--muted); }
.main { flex: 1; overflow-y: auto; padding: 26px; }
.only-narrow { display: none; }

/* panels */
.panel { max-width: 1100px; margin: 0 auto; }
.panel.narrow { max-width: 560px; }
h1 { font-size: 24px; margin: 0 0 4px; font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; }
.lead { color: #b8bfcf; max-width: 760px; margin: 14px 0 20px; }
.note { color: var(--warn); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 18px; }
.muted { color: var(--muted); }
.space-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.space-actions { display: flex; gap: 8px; align-items: center; }
.back { display: inline-block; margin-bottom: 12px; font-size: 14px; }
.loading, .empty { color: var(--muted); padding: 30px 0; text-align: center; }
.empty.bad { color: var(--bad); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { background: none; border: 0; color: var(--muted); font: inherit; padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }

/* members */
.add-member { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 8px; }
.members { display: grid; gap: 10px; }
.member { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.m-name { font-weight: 600; }
.m-mail { font-size: 13px; color: var(--muted); word-break: break-all; }
.m-access { display: flex; flex-wrap: wrap; gap: 6px; }
.m-actions { display: flex; gap: 6px; }
.pill { font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; }
.tag { font-size: 11px; color: var(--accent); border: 1px solid rgba(91,140,255,.4); border-radius: 20px; padding: 0 7px; margin-left: 6px; font-weight: 500; }
.tag.warn { color: var(--warn); border-color: rgba(242,184,75,.4); }

/* apps and roles */
.apps, .mine { display: grid; gap: 12px; }
.app-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.app-card.dirty { border-color: rgba(91,140,255,.55); }
.app-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.app-head.static { cursor: default; }
.app-head input { transform: scale(1.15); }
.app-name { font-weight: 600; font-size: 16px; }
.app-host { color: var(--muted); font-size: 13px; }
.app-count { margin-left: auto; font-size: 12px; color: var(--accent); }
.app-blurb { color: var(--muted); font-size: 13px; padding: 0 16px 12px 44px; margin-top: -8px; }
.roles { border-top: 1px solid var(--line); padding: 8px 16px 14px; display: grid; gap: 4px; }
.r-group-name { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 6px; }
.role { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.role:hover { background: var(--panel-2); }
.role.on { background: rgba(91,140,255,.07); border-color: rgba(91,140,255,.3); }
.role.static { cursor: default; }
.role.covered:not(.on) { opacity: .55; }
.role input { margin-top: 4px; }
.r-text { display: grid; gap: 2px; min-width: 0; }
.r-label { font-weight: 500; }
.r-desc { color: #b8bfcf; font-size: 13px; }
.r-caps { color: var(--muted); font-size: 12px; }
.r-scope { margin-top: 6px; }
.r-vals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* activity */
.audit { display: grid; gap: 2px; }
.a-row { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.a-at { color: var(--muted); font-variant-numeric: tabular-nums; }

/* dialog */
.dlg { position: fixed; inset: 0; background: rgba(4,6,10,.72); display: grid; place-items: center; padding: 16px; z-index: 40; }
.dlg-card { width: 100%; max-width: 620px; max-height: 88vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.dlg-body { padding: 16px; overflow-y: auto; flex: 1; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.dlg-foot:empty { display: none; }
.search { margin-bottom: 10px; }
.sc-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sc-tools span { margin-right: auto; color: var(--muted); font-size: 13px; }
.sc-list { display: grid; gap: 2px; }
.sc-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.sc-item:hover { background: var(--panel-2); }
.sc-item.on { background: rgba(91,140,255,.08); }
.sc-label { font-weight: 500; word-break: break-all; }
.sc-value { color: var(--muted); font-size: 12px; margin-left: auto; word-break: break-all; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: calc(100% - 32px); }
.toast.bad { border-color: rgba(255,93,108,.5); color: #ffc2c8; }

@media (max-width: 820px) {
  .only-narrow { display: inline-block; }
  .brand span { display: none; }
  .me-name { display: none; }
  .side { position: fixed; top: 52px; bottom: 0; left: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; width: 82%; max-width: 300px; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .main { padding: 18px 16px; }
  .add-member { grid-template-columns: 1fr; }
  .member { grid-template-columns: 1fr; }
  .a-row { grid-template-columns: 1fr; gap: 2px; }
  .acting .chip { display: none; }
}
