/* platform.css — auth account menu + admin suite (Organization / Users / Policies).
   Uses translucent surfaces so it reads well on the shell's dark (and light) themes. */

/* Account menu — inherits the shell's .menu-pop frame + theming; these just style
   the header block and role chip using the shell's own tokens. */
.ava-acct .ava-acct-head { padding: 8px 10px 10px; }
.ava-acct-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.ava-acct-email { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.ava-acct-role { display: inline-block; margin-top: 9px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.ava-acct .ava-signout { width: 100%; color: var(--danger); }
.ava-acct .ava-signout .ic { color: var(--danger); }
.ava-acct .ava-signout:hover { color: var(--danger); }

/* Approval queue in the Alerts popover */
.bell-sec { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .55; padding: 8px 12px 4px; }
.bell-item-btn { width: 100%; text-align: left; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.bell-item-btn:hover { background: var(--muted); }

/* ── Floating-label fields (Revolut-style): the label sits as the placeholder and
   floats up to a small caption once the field is filled/focused. No wasted space. */
.ff { position: relative; }
.ff > input, .ff > select, .ff > .ms-field {
  width: 100%; box-sizing: border-box; min-height: 56px;
  background: rgba(128,128,128,.10); border: 1px solid rgba(128,128,128,.16);
  border-radius: 12px; padding: 23px 14px 9px; font-size: 14px; color: var(--ink); font-family: inherit; outline: none; transition: background .12s, border-color .12s, box-shadow .12s;
}
.ff > input:hover, .ff > select:hover, .ff > .ms-field:hover { border-color: rgba(128,128,128,.30); }
.ff > label {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 400; color: var(--ink-faint);
  pointer-events: none; transition: top .14s ease, transform .14s ease, font-size .14s ease, letter-spacing .14s; margin: 0;
}
.ff > input:focus, .ff > select:focus, .ff > .ms-field:focus, .ff.open > .ms-field {
  background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.ff > input:focus + label, .ff > input:not(:placeholder-shown) + label, .ff:focus-within > label, .ff.filled > label,
.ff:has(.pz-dd-trigger.open) > label {
  top: 9px; transform: none; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-faint);
  max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ff > input::placeholder { color: transparent; }
.ff.filled > input::placeholder, .ff > input:focus::placeholder { color: var(--ink-faint); opacity: .55; }
.ff > select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.ff.disabled { opacity: .7; }
.ff > input:disabled { cursor: not-allowed; }

/* When enhanceSelects() wraps a .ff select into a .pz-dd widget, style its
   trigger AS the floating-field box (the frosted .pz-dd-pop popup is kept). */
.ff > .pz-dd { display: block; width: 100%; position: relative; }
/* Specificity note: must beat `body.glass .pz-dd-trigger` (0,2,1) in styles.css,
   otherwise enhanced selects render a darker fill than the text inputs. */
.ff > .pz-dd > .pz-dd-trigger {
  display: block; position: relative; width: 100%; box-sizing: border-box; min-width: 0; min-height: 56px;
  padding: 23px 38px 9px 14px; text-align: left; background: rgba(128,128,128,.10);
  border: 1px solid rgba(128,128,128,.16); border-radius: 12px;
  font-size: 14px; font-weight: 400; color: var(--ink);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.ff .pz-dd-trigger > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff .pz-dd-trigger .ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); margin: 0; }
.ff .pz-dd-trigger.open .ic { transform: translateY(-50%) rotate(180deg); }
.ff .pz-dd-trigger:hover { border-color: rgba(128,128,128,.30); }
.ff .pz-dd-trigger.open, .ff .pz-dd:focus-within .pz-dd-trigger {
  background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Multi-select dropdown (compact — for role lists etc.) */
.ff .ms-field { display: flex; align-items: center; gap: 6px; cursor: pointer; text-align: left; min-height: 56px; flex-wrap: wrap; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ms-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 7px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.ms-chip b { cursor: pointer; opacity: .7; font-weight: 700; }
.ms-chip b:hover { opacity: 1; }
.ms-caret { margin-left: auto; color: var(--ink-faint); }
.ms-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 280px; overflow: auto; }
.ms-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.ms-opt:hover { background: var(--muted); }
.ms-opt .ms-box { width: 17px; height: 17px; flex: 0 0 auto; border: 1.5px solid var(--line-strong); border-radius: 5px; position: relative; }
.ms-opt.on .ms-box { background: var(--accent); border-color: var(--accent); }
.ms-opt.on .ms-box::after { content: ''; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Connectors (Settings → Connectors) */
.set-subhead { font-size: 13px; font-weight: 700; letter-spacing: .02em; margin: 20px 0 8px; color: var(--ink); }
.conn-row { align-items: center; flex-wrap: wrap; row-gap: 10px; }
.conn-row .tpl-main { flex: 1 1 200px; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }
.conn-row .tpl-sub { white-space: normal; }
.conn-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }
.conn-pill { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--muted); color: var(--ink-soft); }
.conn-pill.on { background: rgba(46,204,113,.16); color: #46b06e; }
.conn-pill.managed { background: var(--accent-soft); color: var(--accent-ink); }
.conn-btn { padding: 6px 14px; font-size: 13px; }

.ava-admin { display:flex; gap:0; height:100%; min-height:0; }
.aa-nav { width:210px; flex:0 0 210px; padding:18px 12px; border-right:1px solid rgba(128,128,128,.22); }
.aa-nav-title { font-size:12px; letter-spacing:.1em; text-transform:uppercase; opacity:.6; padding:0 10px 10px; }
.aa-navitem { display:block; width:100%; text-align:left; padding:10px 12px; margin-bottom:4px; border:0; border-radius:9px; background:transparent; color:inherit; font:inherit; font-size:14px; cursor:pointer; }
.aa-navitem:hover { background:rgba(128,128,128,.14); }
.aa-navitem.active { background:var(--accent-soft); color:var(--accent-ink); font-weight:600; }

.aa-body { flex:1; min-width:0; padding:26px 30px; overflow:auto; }
.aa-h1 { font-size:22px; font-weight:700; margin:0 0 6px; }
.aa-head-row { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.aa-head-row .btn { flex:0 0 auto; }
.aa-note { opacity:.7; font-size:13.5px; line-height:1.55; margin:0 0 22px; max-width:760px; }
.aa-note.sm { font-size:12.5px; margin:10px 0 0; }
.aa-empty { opacity:.55; padding:30px; text-align:center; }
.aa-empty.sm { padding:14px; font-size:13px; }

/* Organization columns */
.aa-cols { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.aa-col { background:rgba(128,128,128,.08); border:1px solid rgba(128,128,128,.2); border-radius:12px; overflow:hidden; }
.aa-col-head { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; font-weight:600; font-size:13.5px; border-bottom:1px solid rgba(128,128,128,.2); }
.aa-add { border:0; background:var(--accent-soft); color:var(--accent-ink); border-radius:7px; padding:5px 10px; font-size:12.5px; font-weight:600; cursor:pointer; white-space:nowrap; }
.aa-list { padding:8px; display:flex; flex-direction:column; gap:6px; max-height:52vh; overflow:auto; }
.aa-item { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 10px; border-radius:8px; background:rgba(128,128,128,.1); }
.aa-item-name { font-size:13.5px; display:flex; flex-direction:column; }
.aa-sub { font-size:11.5px; opacity:.55; }
.aa-item-actions { display:flex; gap:4px; flex:0 0 auto; }
.aa-item-actions button { border:0; background:rgba(128,128,128,.2); color:inherit; border-radius:6px; padding:4px 8px; font-size:12px; cursor:pointer; }
.aa-item-actions button:hover { background:rgba(128,128,128,.34); }

/* Tables */
.aa-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.aa-table th { text-align:left; font-size:11.5px; letter-spacing:.06em; text-transform:uppercase; opacity:.55; padding:8px 12px; border-bottom:1px solid rgba(128,128,128,.25); }
.aa-table td { padding:11px 12px; border-bottom:1px solid rgba(128,128,128,.14); vertical-align:middle; }
.aa-table td.aa-r, .aa-table th.aa-r { text-align:right; }
.aa-uname { font-weight:600; }
.aa-uemail { font-size:12px; opacity:.55; }
.aa-btn { border:0; background:var(--accent-soft); color:var(--accent-ink); border-radius:7px; padding:6px 12px; font-size:12.5px; font-weight:600; cursor:pointer; }
.aa-badge { font-size:11.5px; padding:3px 9px; border-radius:999px; background:rgba(128,128,128,.2); }
.aa-badge.ok { background:rgba(46,204,113,.18); color:#7ee2a8; }
.aa-badge.bad { background:rgba(255,80,80,.16); color:#ff9d9d; }

/* Policy segmented control + scope picker */
.aa-scope { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.aa-scope label { font-size:12.5px; opacity:.7; }
.aa-scope select, .aa-form2 select, .aa-form2 input, .form-field select, .form-field input { }
.aa-seg { display:inline-flex; border:1px solid rgba(128,128,128,.3); border-radius:9px; overflow:hidden; }
.aa-seg button { border:0; background:transparent; color:inherit; padding:6px 14px; font-size:12.5px; cursor:pointer; border-right:1px solid rgba(128,128,128,.24); }
.aa-seg button:last-child { border-right:0; }
.aa-seg button.on { background:var(--accent-soft); color:var(--accent-ink); font-weight:600; }
.aa-seg button:disabled { opacity:.4; cursor:not-allowed; }

/* Forms inside admin modals */
.aa-form2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.aa-form2 .ff.ms { grid-column:1 / -1; }
.aa-fieldset { margin-top:14px; padding-top:12px; border-top:1px solid rgba(128,128,128,.2); }
.aa-fs-label { font-size:12px; letter-spacing:.05em; text-transform:uppercase; opacity:.55; margin-bottom:8px; }
.aa-checks { display:grid; grid-template-columns:repeat(3,1fr); gap:6px 10px; }
.aa-check { display:flex; align-items:center; gap:9px; font-size:13px; cursor:pointer; padding:7px 9px; border-radius:9px; transition:background .12s; }
.aa-check:hover { background:var(--muted); }
/* Modern accent checkbox (consistent with the rest of the app). */
.aa-check input[type="checkbox"] { appearance:none; -webkit-appearance:none; width:18px; height:18px; flex:0 0 auto; margin:0; border:1.5px solid var(--line-strong); border-radius:6px; background:var(--surface); cursor:pointer; position:relative; transition:background .12s, border-color .12s; }
.aa-check input[type="checkbox"]:hover { border-color:var(--accent); }
.aa-check input[type="checkbox"]:checked { background:var(--accent); border-color:var(--accent); }
.aa-check input[type="checkbox"]:checked::after { content:''; position:absolute; left:5px; top:1.5px; width:5px; height:9px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
.aa-check input[type="checkbox"]:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* Fallback modal (only used if the shell's modal() isn't available) */
.ava-modal-wrap { position:fixed; inset:0; z-index:9998; background:rgba(4,10,22,.55); display:flex; align-items:center; justify-content:center; padding:20px; }
.ava-modal { width:520px; max-width:96vw; max-height:90vh; overflow:auto; background:#12203c; color:#eaf1ff; border:1px solid rgba(255,255,255,.14); border-radius:14px; }
.ava-modal-wide .ava-modal { width:640px; max-width:96vw; }
/* The shell puts the cls directly on .modal, so target .modal.aa-modal-wide. */
.modal.aa-modal-wide { width:880px; max-width:96vw; }
.ava-modal .modal-head { display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid rgba(255,255,255,.1); font-weight:700; }
.ava-modal .modal-body { padding:18px; }
.ava-modal .modal-foot { display:flex; gap:8px; justify-content:flex-end; padding:14px 18px; border-top:1px solid rgba(255,255,255,.1); }
.ava-modal .modal-x { cursor:pointer; }
.ava-modal .form-field { margin-bottom:12px; display:flex; flex-direction:column; gap:5px; }
.ava-modal .form-field label { font-size:12.5px; opacity:.7; }
.ava-modal .form-field input, .ava-modal .form-field select { padding:9px 11px; border-radius:8px; border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.06); color:#fff; font:inherit; }
.ava-modal .btn { border:0; border-radius:8px; padding:9px 15px; font-weight:600; font-size:14px; cursor:pointer; background:rgba(255,255,255,.12); color:#fff; }
.ava-modal .btn.primary { background:linear-gradient(135deg,#2f6bff,#4d8bff); }

/* Licensing */
.aa-lic-banner { display:flex; align-items:center; justify-content:space-between; gap:16px; background:rgba(47,107,255,.12); border:1px solid rgba(47,107,255,.3); border-radius:12px; padding:16px 18px; margin-bottom:18px; }
.aa-lic-tier { font-size:17px; font-weight:700; }
.aa-billing { display:flex; align-items:center; gap:10px; margin-bottom:14px; font-size:12.5px; opacity:.8; }
.aa-tiers { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:8px; }
.aa-tier { position:relative; background:rgba(128,128,128,.08); border:1px solid rgba(128,128,128,.22); border-radius:14px; padding:18px; }
.aa-tier.current { border-color:rgba(47,107,255,.6); box-shadow:0 0 0 1px rgba(47,107,255,.4) inset; }
.aa-tier-badge { position:absolute; top:-9px; right:12px; background:linear-gradient(135deg,#2f6bff,#4d8bff); color:#fff; font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; }
.aa-tier-name { font-size:16px; font-weight:700; }
.aa-tier-price { font-size:20px; font-weight:800; margin:6px 0 2px; }
.aa-tier-seats { font-size:12px; opacity:.6; margin-bottom:12px; }
.aa-tier-feats { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.aa-tier-feats li { font-size:12.5px; }
.aa-tier-feats li.on { color:inherit; }
.aa-tier-feats li.off { opacity:.4; }
.aa-inline { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.aa-inline input, .aa-inline select { padding:9px 11px; border-radius:8px; border:1px solid rgba(128,128,128,.28); background:rgba(128,128,128,.08); color:inherit; font:inherit; font-size:13px; }
.aa-inline .btn { border:0; border-radius:8px; padding:9px 15px; font-weight:600; font-size:13.5px; cursor:pointer; background:linear-gradient(135deg,#2f6bff,#4d8bff); color:#fff; }

@media (max-width:1000px){ .aa-cols{ grid-template-columns:1fr 1fr; } .aa-form2{ grid-template-columns:1fr; } .aa-checks{ grid-template-columns:1fr 1fr; } .aa-tiers{ grid-template-columns:1fr 1fr; } }
