/* ===== User Control Center (2026-10-30) ===================================
   Same tokens as app.css (paper / surface / ink / accent), so it follows the
   light and dark themes on its own. Every class starts with "ucc-". */

/* Home: the small corner button (superadmins only) */
.menu-hero{ position:relative; }
.ucc-corner{
  position:absolute; top:14px; right:14px; display:inline-flex; align-items:center; gap:7px;
  padding:7px 12px 7px 9px; border-radius:99px; border:1px solid var(--line); background:var(--surface);
  color:var(--slate); font-size:12px; font-weight:600; cursor:pointer; box-shadow:var(--shadow);
  transition:color .15s, border-color .15s, transform .15s;
}
.ucc-corner svg{ width:16px; height:16px; color:var(--accent); }
.ucc-corner:hover{ color:var(--ink); border-color:var(--accent); transform:translateY(-1px); }
.ucc-corner:focus-visible{ outline:2px solid var(--focus); outline-offset:2px; }
@media (max-width:560px){ .ucc-corner .ucc-corner-text{ display:none; } .ucc-corner{ padding:8px; } }

.ucc{ max-width:1480px; margin:0 auto; }
.ucc svg{ flex:none; }
.ucc .spacer{ flex:1; }
.ucc .card + .card, .ucc .card + #ucc-panel, .ucc #ucc-panel > .card{ margin-top:12px; }
.sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }

/* Header */
.ucc-head{ padding:18px 20px 0; }
.ucc-head-main{ display:flex; gap:14px; align-items:flex-start; flex-wrap:wrap; }
.ucc-head-main .section-sub{ margin:2px 0 0; max-width:760px; }
.ucc-head-icon{ width:42px; height:42px; border-radius:11px; background:var(--accent-soft); color:var(--accent-ink); display:grid; place-items:center; }
.ucc-head-icon svg{ width:24px; height:24px; }
.ucc-admins{ display:flex; gap:8px; align-items:center; margin-top:14px; font-size:12.5px; color:var(--slate); }
.ucc-admins svg{ width:15px; height:15px; color:var(--warn); }
.ucc-tabs{ display:flex; gap:4px; margin-top:14px; border-top:1px solid var(--line); padding-top:2px; }
.ucc-tab{ background:none; border:none; border-bottom:2px solid transparent; padding:11px 14px 10px; font-weight:600; font-size:13px; color:var(--slate); cursor:pointer; }
.ucc-tab:hover{ color:var(--ink); }
.ucc-tab.on{ color:var(--accent-ink); border-bottom-color:var(--accent); }
.ucc-count{ display:inline-block; min-width:20px; padding:0 6px; border-radius:99px; background:var(--surface-2); color:var(--slate); font-family:"IBM Plex Mono",monospace; font-size:11px; line-height:18px; text-align:center; }
.ucc-tab.on .ucc-count{ background:var(--accent-soft); color:var(--accent-ink); }

/* Filters */
.ucc-filters{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.ucc-filters select{ border:1px solid var(--line); border-radius:8px; padding:8px 10px; background:var(--surface); color:var(--ink); }
.ucc-search{ display:flex; align-items:center; gap:8px; flex:1 1 260px; max-width:420px; border:1px solid var(--line); border-radius:8px; padding:0 10px; background:var(--paper); }
.ucc-search:focus-within{ outline:2px solid var(--focus); outline-offset:1px; }
.ucc-search svg{ width:16px; height:16px; color:var(--slate-soft); }
.ucc-search input{ border:none; background:none; outline:none; padding:9px 0; width:100%; color:var(--ink); }
.ucc-search.big{ max-width:none; }
.ucc-search.big input{ padding:12px 0; font-size:15px; }

/* Segmented control (status filter, None/View/Edit, Active/Deactivated) */
.ucc-seg{ display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--surface); }
.ucc-seg button{ border:none; background:none; padding:7px 11px; font-size:12.5px; font-weight:600; color:var(--slate); cursor:pointer; border-right:1px solid var(--line); white-space:nowrap; }
.ucc-seg button:last-child{ border-right:none; }
.ucc-seg button:hover:not(:disabled){ background:var(--surface-2); color:var(--ink); }
.ucc-seg button.on{ background:var(--accent); color:#fff; }
.ucc-seg button.on .ucc-count{ background:rgba(255,255,255,.22); color:#fff; }
.ucc-seg button.on.v{ background:var(--focus); }
.ucc-seg button.on.n{ background:var(--surface-2); color:var(--slate); }
.ucc-seg button.on.off{ background:var(--critical); }
.ucc-seg button:disabled{ cursor:not-allowed; opacity:.55; }
.ucc-seg button:focus-visible{ outline:2px solid var(--focus); outline-offset:-2px; }

/* People table */
.ucc-table-wrap{ border:1px solid var(--line); border-radius:10px; overflow:auto; }
.ucc-table{ width:100%; border-collapse:collapse; }
.ucc-table thead th{ position:sticky; top:0; z-index:1; }
.ucc-table tbody td{ vertical-align:top; padding:12px 10px; }
.ucc-table tbody tr[data-upn]{ cursor:pointer; }
.ucc-table tr.ucc-off td{ background:repeating-linear-gradient(-45deg, transparent 0 10px, var(--critical-soft) 10px 11px); }
.ucc-table tr.ucc-off .ucc-access, .ucc-table tr.ucc-off .ucc-appr{ opacity:.55; }
.ucc-person{ display:flex; gap:10px; align-items:flex-start; min-width:220px; }
.ucc-who{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.ucc-who strong{ font-size:13.5px; line-height:1.3; }
.ucc-mail{ display:block; font-family:"IBM Plex Mono",monospace; font-size:11.5px; color:var(--slate); word-break:break-all; }
.ucc-avatar{ width:34px; height:34px; border-radius:50%; flex:none; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent-ink); font-weight:700; font-size:12.5px; letter-spacing:.02em; }
.ucc-avatar.sm{ width:30px; height:30px; font-size:12px; }
.ucc-avatar.lg{ width:52px; height:52px; font-size:18px; }
.ucc-badges{ display:flex; gap:4px; flex-wrap:wrap; margin:2px 0; }
.ucc-badge{ display:inline-block; padding:1px 7px; border-radius:99px; font-size:10.5px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; background:var(--surface-2); color:var(--slate); vertical-align:middle; width:max-content; }
.ucc-badge.sa{ background:var(--warn-soft); color:var(--warn); }
.ucc-badge.new{ background:var(--accent-soft); color:var(--accent-ink); }
.ucc-access{ min-width:320px; }
.ucc-line{ display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin:2px 0 6px; }
.ucc-line:last-child{ margin-bottom:0; }
.ucc-where{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; color:var(--slate); margin-right:3px; min-width:150px; }
.ucc-where.ship svg{ width:14px; height:14px; color:var(--focus); }
.ucc-chip{ display:inline-flex; align-items:center; gap:5px; padding:2px 3px 2px 8px; border:1px solid var(--line); border-radius:6px; background:var(--surface); font-size:12px; font-weight:600; white-space:nowrap; }
.ucc-chip.off{ opacity:.55; text-decoration:line-through; }
.ucc-chip.appr{ padding-right:8px; background:var(--surface-2); }
.ucc-lv{ display:inline-grid; place-items:center; width:18px; height:18px; border-radius:4px; font-family:"IBM Plex Mono",monospace; font-size:10.5px; font-weight:700; }
.ucc-lv.e{ background:var(--accent); color:#fff; }
.ucc-lv.v{ background:transparent; color:var(--focus); box-shadow:inset 0 0 0 1.5px var(--focus); }
.ucc-full{ display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:6px; background:var(--warn-soft); color:var(--warn); font-size:12px; font-weight:700; }
.ucc-full svg{ width:14px; height:14px; }
.ucc-act-h{ width:1%; }
.ucc-act{ white-space:nowrap; text-align:right; }
.ucc-act .btn + .btn{ margin-left:4px; }
.ucc-good{ color:var(--good); }
.ucc-legend{ margin-top:12px; font-size:12px; color:var(--slate-soft); display:flex; align-items:center; gap:6px; flex-wrap:wrap; }

/* Small things */
.ucc-loading{ display:flex; align-items:center; gap:10px; color:var(--slate); }
.ucc-spinner{ display:inline-block; width:14px; height:14px; border-radius:50%; border:2px solid var(--line); border-top-color:var(--accent); animation:ucc-spin .8s linear infinite; vertical-align:-2px; margin-right:6px; }
@keyframes ucc-spin{ to{ transform:rotate(360deg); } }
.ucc-link{ background:none; border:none; padding:2px 4px; color:var(--accent-ink); font-weight:600; font-size:12px; cursor:pointer; border-radius:4px; }
.ucc-link:hover{ text-decoration:underline; }
.ucc-link.strong{ font-size:13px; padding:0; }
.ucc-more{ margin-top:10px; }
.ucc-toast{ position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:1000; padding:11px 18px; border-radius:9px; color:#fff; font-size:13px; font-weight:600; box-shadow:0 8px 24px rgba(0,0,0,.22); max-width:min(640px,92vw); transition:opacity .25s, transform .25s; }
.ucc-toast.ok{ background:#2F8F5B; } .ucc-toast.warn{ background:#B4790F; } .ucc-toast.err{ background:#B23C29; }
.ucc-toast.out{ opacity:0; transform:translate(-50%, 8px); }

/* Dialogs */
dialog.ucc-dialog{ background:var(--surface); color:var(--ink); width:min(620px, 94vw); max-width:none; }
dialog.ucc-dialog.sm{ width:min(460px, 94vw); }
dialog.ucc-dialog .dialog-body{ max-height:calc(92vh - 80px); overflow:auto; }
.ucc-confirm-text{ color:var(--slate); font-size:13.5px; margin:8px 0 0; }
.btn.ucc-danger-solid{ background:var(--critical); border-color:var(--critical); color:#fff; }
.ucc-results{ margin-top:10px; display:flex; flex-direction:column; gap:4px; min-height:40px; }
.ucc-result{ display:flex; align-items:center; gap:10px; text-align:left; width:100%; padding:9px 10px; border:1px solid transparent; border-radius:9px; background:none; color:var(--ink); cursor:pointer; }
.ucc-result:hover, .ucc-result:focus-visible{ background:var(--surface-2); border-color:var(--line); outline:none; }
.ucc-result > span:nth-child(2){ flex:1; min-width:0; }
.ucc-noresult{ padding:10px; }

/* Person editor */
.ucc-ed-head{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.ucc-ed-who .section-title{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin:0; }
.ucc-status{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ucc-off-banner{ margin:12px 0 0; }
.ucc-sections{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px; margin-top:12px; }
.ucc-sections .card + .card{ margin-top:0; }
.ucc-sec{ padding:16px 18px; }
#ucc-sec-service, #ucc-sec-approvals, #ucc-sec-vessels{ grid-column:1 / -1; }
.ucc-sec-title{ font-size:14px; font-weight:700; margin:0; }
.ucc-sec-sub{ color:var(--slate); font-size:12.5px; margin:3px 0 14px; max-width:860px; }
.ucc-note{ display:flex; gap:8px; align-items:center; padding:9px 12px; border-radius:8px; background:var(--warn-soft); color:var(--warn); font-size:12.5px; font-weight:600; margin-bottom:12px; }
.ucc-note svg{ width:15px; height:15px; }
.ucc-empty-sm{ padding:4px 0 12px; }

.ucc-matrix-wrap{ overflow-x:auto; border:1px solid var(--line); border-radius:10px; }
.ucc-matrix{ border-collapse:collapse; width:100%; }
.ucc-matrix thead th{ text-align:center; }
.ucc-matrix th.ucc-mx-branch{ text-align:left; position:sticky; left:0; background:var(--surface); z-index:1; min-width:170px; }
.ucc-matrix thead th.ucc-mx-branch{ background:var(--surface-2); }
.ucc-matrix tbody th.ucc-mx-branch{ font-weight:400; padding:8px 10px; border-bottom:1px solid var(--line); }
.ucc-matrix tbody th.ucc-mx-branch span{ display:block; font-size:11.5px; color:var(--slate); }
.ucc-matrix tbody th.ucc-mx-branch strong{ font-size:13px; }
.ucc-notlive{ display:block; font-style:normal; font-size:10.5px; color:var(--slate-soft); text-transform:uppercase; letter-spacing:.04em; }
.ucc-matrix td{ text-align:center; padding:8px 6px; }
.ucc-matrix .ucc-seg button{ min-width:30px; padding:5px 8px; font-family:"IBM Plex Mono",monospace; }
.ucc-matrix tbody tr:hover, .ucc-matrix tbody tr:hover th{ background:var(--surface-2); }
.ucc-mx-quick{ white-space:nowrap; }

.ucc-mods{ display:flex; flex-direction:column; gap:8px; }
.ucc-mod{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; border:1px solid var(--line); border-radius:9px; flex-wrap:wrap; }
.ucc-mod strong{ display:block; font-size:13px; }

.ucc-appr-list{ display:flex; flex-direction:column; }
.ucc-appr-row{ display:flex; gap:16px; padding:11px 0; border-top:1px solid var(--line); align-items:flex-start; flex-wrap:wrap; }
.ucc-appr-row:first-child{ border-top:none; padding-top:0; }
.ucc-appr-name{ width:260px; flex:none; }
.ucc-appr-name strong{ display:block; font-size:13px; }
.ucc-toggles{ display:flex; flex-wrap:wrap; gap:6px; flex:1; }
.ucc-toggle{ display:inline-flex; align-items:center; gap:5px; padding:6px 11px; border-radius:99px; border:1px solid var(--line); background:var(--surface); color:var(--slate); font-size:12.5px; font-weight:600; cursor:pointer; }
.ucc-toggle:hover{ border-color:var(--accent); color:var(--ink); }
.ucc-toggle.on{ background:var(--accent-soft); border-color:var(--accent); color:var(--accent-ink); }
.ucc-toggle svg{ width:14px; height:14px; }
.ucc-toggle:focus-visible{ outline:2px solid var(--focus); outline-offset:2px; }

.ucc-vrows{ display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.ucc-vrow{ display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:var(--paper); }
.ucc-vrow .field{ margin:0; min-width:150px; }
.ucc-vrow .field:first-child{ min-width:220px; }
.ucc-vrow .btn{ margin-left:auto; }
.ucc-check{ display:inline-flex; align-items:center; gap:8px; font-size:13px; cursor:pointer; padding:7px 0; }
.ucc-check input{ width:16px; height:16px; accent-color:var(--accent); }
.ucc-check.card-like{ display:flex; align-items:flex-start; padding:10px 12px; border:1px solid var(--line); border-radius:9px; }
.ucc-check.card-like strong{ display:block; }
.ucc-check.off{ opacity:.6; }
.ucc-owner-pick{ display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:8px; }
.ucc-vpick{ display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:0 12px; }

.ucc-savebar{ position:sticky; bottom:0; z-index:5; display:flex; align-items:center; gap:10px; margin-top:12px; padding:12px 16px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 -6px 20px rgba(22,26,36,.08); }
.ucc-dirty{ font-size:12.5px; color:var(--slate-soft); }
.ucc-dirty.on{ color:var(--warn); font-weight:700; }
.ucc-dirty.on::before{ content:""; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--warn); margin-right:6px; vertical-align:1px; }

/* Owners tab */
.ucc-owners th.sw, .ucc-owners td.sw{ text-align:center; white-space:nowrap; }
.ucc-owners td.sw input{ width:16px; height:16px; accent-color:var(--accent); }
.ucc-mail-cell{ font-family:"IBM Plex Mono",monospace; font-size:11.5px; }

/* Narrow screens: the people table becomes cards */
@media (max-width:900px){
  .ucc-sections{ grid-template-columns:minmax(0,1fr); }
  .ucc-appr-name{ width:100%; }
}
@media (max-width:760px){
  .ucc-table thead{ display:none; }
  .ucc-table, .ucc-table tbody, .ucc-table tr, .ucc-table td{ display:block; width:100%; }
  .ucc-table tbody tr{ border-bottom:1px solid var(--line); padding:8px 2px; }
  .ucc-table tbody td{ border:none; padding:4px 10px; }
  .ucc-access{ min-width:0; }
  .ucc-where{ min-width:0; }
  .ucc-act{ text-align:left; }
  .ucc-owners td.sw{ display:inline-block; width:auto; }
  .ucc-savebar{ flex-wrap:wrap; }
}
.ucc-link.strong{ text-align:left; }
@media (max-width:760px){
  .ucc-filters .ucc-seg{ max-width:100%; overflow-x:auto; }
  .ucc-filters select{ flex:1 1 140px; }
  .ucc-head-main .btn.primary{ width:100%; }
}
.ucc-sec{ min-width:0; }
