/*
 * Iris Platform — дизайн-система застосунку (портовано з docs/design/*).
 * Правила світу — DESIGN.md. Джерело токенів — iris-brandbook (монохром) +
 * UI-акцент soft violet (тільки інтерактив). Не хардкодити кольори у в'юхах.
 */

:root {
  color-scheme: dark;

  --bg:#000000; --surface-1:#0A0A0B; --surface-2:#141416; --surface-3:#1C1C1F; --surface-input:#0E0E10;
  --line:rgba(255,255,255,.08); --line-strong:rgba(255,255,255,.14); --line-faint:rgba(255,255,255,.05);
  --text:#F5F5F7; --text-2:#A6A6AD; --text-3:#6E6E76; --text-on-accent:#FFFFFF;

  --violet-200:#D4CBFB; --violet-300:#BCAEF9; --violet-400:#A08FF3;
  --violet-500:#8A78EE; --violet-600:#7A67E6; --violet-700:#6857D6;
  --accent:var(--violet-600); --accent-hover:var(--violet-500); --accent-active:var(--violet-700);
  --accent-text:var(--violet-300);
  --accent-tint:rgba(138,120,238,.12); --accent-tint-2:rgba(138,120,238,.20);
  --focus-ring:rgba(138,120,238,.55); --accent-glow:0 0 0 4px rgba(138,120,238,.16);

  --success:#35A379; --danger:#D25A4C; --warning:#D19A2A; --info:#5A8FCB;
  --success-tint:rgba(53,163,121,.14); --danger-tint:rgba(210,90,76,.14); --warning-tint:rgba(209,154,42,.14);

  --font-ui:"Inter",-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",Arial,sans-serif;
  --font-brand:"Archivo","Helvetica Neue",Arial,sans-serif;
  --font-mono:"JetBrains Mono",ui-monospace,"SF Mono",Menlo,monospace;

  --r-sm:8px; --r-md:12px; --r-lg:18px; --r-xl:24px; --r-full:9999px;
  --shadow-1:0 1px 2px rgba(0,0,0,.4); --shadow-2:0 8px 30px rgba(0,0,0,.45);
  --ease:cubic-bezier(.22,.61,.36,1); --dur-1:120ms; --dur-2:180ms; --dur-3:260ms;
}

html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; letter-spacing: -.011em;
}
::selection { background: var(--accent-tint-2); color: #fff; }
.iris a { color: inherit; text-decoration: none; }
.iris button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); letter-spacing: -.02em; }

/* ============ APP SHELL ============ */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface-1); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 22px 22px 18px; display: flex; align-items: center; gap: 10px; }
.brand img { height: 20px; width: auto; display: block; opacity: .96; }
.brand .badge { margin-left: auto; font: 500 10px/1 var(--font-mono); color: var(--text-3); border: 1px solid var(--line); padding: 4px 6px; border-radius: var(--r-full); letter-spacing: .04em; }

.nav { padding: 8px 12px; overflow-y: auto; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); text-transform: uppercase; padding: 8px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-md); color: var(--text-2); font-weight: 500; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); position: relative; }
.nav-item svg { width: 18px; height: 18px; flex: none; stroke-width: 1.6; opacity: .9; }
.nav-item .count { margin-left: auto; font: 500 11px/1 var(--font-mono); color: var(--text-3); }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-tint); color: var(--text); }
.nav-item.active svg { color: var(--accent-text); opacity: 1; }
.nav-item.active .count { color: var(--accent-text); }

.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); transition: background var(--dur-1) var(--ease); width: 100%; text-align: left; background: none; border: none; }
.userchip:hover { background: var(--surface-3); }
.avatar { width: 30px; height: 30px; border-radius: var(--r-full); flex: none; background: linear-gradient(150deg, var(--violet-500), var(--violet-700)); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.userchip .who { line-height: 1.2; min-width: 0; }
.userchip .who b { font-weight: 600; font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip .who span { font-size: 11px; color: var(--text-3); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 60px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(140%) blur(18px); position: sticky; top: 0; z-index: 20; }
.search { display: flex; align-items: center; gap: 9px; background: var(--surface-input); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; width: 320px; color: var(--text-3); transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.search:focus-within { border-color: var(--focus-ring); box-shadow: var(--accent-glow); }
.search svg { width: 16px; height: 16px; stroke-width: 1.7; }
.search input { border: none; background: none; outline: none; color: var(--text); width: 100%; font-size: 13.5px; }
.search input::placeholder { color: var(--text-3); }
.search kbd { font: 500 11px/1 var(--font-mono); color: var(--text-3); border: 1px solid var(--line); border-radius: 6px; padding: 3px 5px; }
.topbar-spacer { flex: 1; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--text-2); transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); position: relative; background: none; border: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; stroke-width: 1.6; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface-1); }

.content { padding: 28px 32px 64px; max-width: 1200px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 640; letter-spacing: -.02em; }
.page-head p { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; }

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; height: 38px; padding: 0 16px; border-radius: var(--r-md); font-weight: 560; font-size: 13.5px; letter-spacing: -.01em; border: none; cursor: pointer; transition: transform var(--dur-1) var(--ease), background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease); white-space: nowrap; user-select: none; }
.btn svg { width: 16px; height: 16px; stroke-width: 1.8; flex: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus-ring); }
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-1), var(--accent-glow); }
.btn-primary:active { background: var(--accent-active); box-shadow: none; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--accent-tint); color: var(--accent-text); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: var(--danger-tint); border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; box-shadow: none; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* ============ PANELS / TABLE / PILLS ============ */
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; gap: 12px 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h3 { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.panel-head .sub { color: var(--text-3); font-size: 12.5px; }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.ribbon { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.ribbon .cell { padding: 18px 20px; border-right: 1px solid var(--line); }
.ribbon .cell:last-child { border-right: none; }
.ribbon .k { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.ribbon .k svg { width: 14px; height: 14px; stroke-width: 1.7; color: var(--text-3); }
.ribbon .v { font-size: 27px; font-weight: 620; letter-spacing: -.02em; margin-top: 10px; }
.ribbon .v small { font-size: 15px; color: var(--text-3); font-weight: 500; }
.delta { font-size: 12px; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--success); } .delta.flat { color: var(--text-3); }
.delta svg { width: 13px; height: 13px; stroke-width: 2; }
.grid-2 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 22px; align-items: start; }

.iris-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.iris-table thead th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); padding: 11px 18px; border-bottom: 1px solid var(--line); }
.iris-table thead th:nth-child(1), .iris-table tbody td:nth-child(1) { width: 44%; }
.iris-table thead th:nth-child(2), .iris-table tbody td:nth-child(2) { width: 27%; }
.iris-table thead th:nth-child(3), .iris-table tbody td:nth-child(3) { width: 19%; }
.iris-table thead th:nth-child(4), .iris-table tbody td:nth-child(4) { width: 10%; text-align: right; }
.iris-table tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line-faint); font-size: 13.5px; vertical-align: middle; }
.iris-table tbody tr { transition: background var(--dur-1) var(--ease); }
.iris-table tbody tr:hover { background: var(--surface-3); }
.iris-table tbody tr:last-child td { border-bottom: none; }
.cellname { display: flex; align-items: center; gap: 11px; }
.cellname > div { min-width: 0; }
.flag { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-3); display: grid; place-items: center; font-size: 13px; flex: none; }
.cellname b { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cellname span { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iris-table.auto { table-layout: auto; }
.iris-table.auto th, .iris-table.auto td { width: auto; }
.iris-table.auto td:last-child, .iris-table.auto th:last-child { text-align: right; white-space: nowrap; }
.row-link { cursor: pointer; }
.avatar-sm { width: 34px; height: 34px; border-radius: var(--r-full); background: linear-gradient(150deg, var(--violet-500), var(--violet-700)); display: grid; place-items: center; font-weight: 650; font-size: 12px; color: #fff; flex: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 550; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--success); background: var(--success-tint); }
.pill.grace { color: var(--warning); background: var(--warning-tint); }
.pill.susp { color: var(--danger); background: var(--danger-tint); }
.pill.neutral { color: var(--text-2); background: var(--surface-3); }

/* ============ CONTROLS ============ */
.stack { display: flex; flex-direction: column; gap: 20px; padding: 18px; }
.field-label { font-size: 12px; color: var(--text-2); font-weight: 550; margin-bottom: 9px; display: flex; justify-content: space-between; }
.field-label .val { color: var(--accent-text); font-family: var(--font-mono); font-size: 12px; }
input[type=range].iris-range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; }
input[type=range].iris-range::-webkit-slider-runnable-track { height: 5px; border-radius: var(--r-full); background: var(--track, var(--surface-3)); }
input[type=range].iris-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; margin-top: -6.5px; background: #fff; border: 1px solid rgba(0,0,0,.15); box-shadow: 0 1px 3px rgba(0,0,0,.5); transition: box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
input[type=range].iris-range:hover::-webkit-slider-thumb { box-shadow: 0 1px 3px rgba(0,0,0,.5), var(--accent-glow); }
input[type=range].iris-range:active::-webkit-slider-thumb { transform: scale(1.08); }
input[type=range].iris-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--focus-ring); }

.toggle { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle .track { position: absolute; inset: 0; border-radius: var(--r-full); background: var(--surface-3); transition: background var(--dur-2) var(--ease); }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); transition: transform var(--dur-2) var(--ease); }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked ~ .knob { transform: translateX(18px); }
.toggle input:focus-visible + .track { box-shadow: 0 0 0 3px var(--focus-ring); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-between .t b { font-weight: 550; font-size: 13.5px; }
.row-between .t span { display: block; font-size: 12px; color: var(--text-3); }

.segmented { display: inline-flex; background: var(--surface-input); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.segmented button { padding: 6px 14px; border-radius: 9px; font-size: 12.5px; font-weight: 550; color: var(--text-2); border: none; background: none; transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.segmented button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }
.segmented button:hover:not(.on) { color: var(--text); }

.tinput { width: 100%; height: 38px; padding: 0 13px; border-radius: var(--r-md); background: var(--surface-input); border: 1px solid var(--line); color: var(--text); font-size: 13.5px; transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.tinput::placeholder { color: var(--text-3); }
.tinput:focus { outline: none; border-color: var(--focus-ring); box-shadow: var(--accent-glow); }

/* ============ AUTH (login) ============ */
.auth-body { display: grid; place-items: center; min-height: 100vh; overflow: hidden; position: relative; }
.ambient { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 0; }
.ambient img { width: 820px; max-width: 120vw; opacity: .05; filter: saturate(0); }
.ambient::after { content: ""; position: absolute; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(circle, var(--accent-tint) 0%, transparent 62%); opacity: .5; }
.auth-wrap { position: relative; z-index: 1; width: 380px; max-width: calc(100vw - 40px); }
.auth-brand { display: flex; justify-content: center; margin-bottom: 34px; }
.auth-brand img { height: 26px; opacity: .98; }
.auth-card { background: color-mix(in srgb, var(--surface-2) 82%, transparent); backdrop-filter: saturate(140%) blur(20px); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 32px 30px; box-shadow: var(--shadow-2); }
.auth-card h1 { font-size: 20px; font-weight: 620; letter-spacing: -.02em; text-align: center; }
.auth-card .lede { text-align: center; color: var(--text-2); font-size: 13.5px; margin-top: 6px; margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-2); margin-bottom: 8px; }
.field .tinput { height: 44px; font-size: 14.5px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.link { color: var(--accent-text); font-size: 12.5px; font-weight: 550; transition: color var(--dur-1) var(--ease); }
.link:hover { color: var(--violet-200); }
.checkrow { display: flex; align-items: center; gap: 10px; margin: 4px 0 22px; cursor: pointer; }
.check { position: relative; width: 20px; height: 20px; flex: none; display: inline-block; }
.check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.check .box { position: absolute; inset: 0; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface-input); transition: all var(--dur-1) var(--ease); }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check .box::after { content: ""; position: absolute; left: 6.5px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform var(--dur-1) var(--ease); }
.check input:checked + .box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--focus-ring); }
.checkrow span { font-size: 13px; color: var(--text-2); }
.btn-auth { width: 100%; height: 46px; border-radius: var(--r-md); background: var(--accent); color: #fff; font-weight: 580; font-size: 14.5px; letter-spacing: -.01em; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; box-shadow: var(--shadow-1); transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease); }
.btn-auth:hover { background: var(--accent-hover); box-shadow: var(--shadow-1), var(--accent-glow); }
.btn-auth:active { background: var(--accent-active); transform: scale(.985); box-shadow: none; }
.btn-auth:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus-ring); }
.btn-auth svg { width: 18px; height: 18px; flex: none; }
.divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--text-3); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-alt { width: 100%; height: 44px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); font-weight: 550; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; transition: background var(--dur-1) var(--ease); }
.btn-alt:hover { background: var(--surface-3); }
.btn-alt svg { width: 17px; height: 17px; }
.auth-foot { text-align: center; margin-top: 26px; color: var(--text-3); font-size: 12px; }
.auth-foot a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.flash { max-width: 360px; margin: 0 auto 16px; padding: 10px 14px; border-radius: var(--r-md); font-size: 13px; text-align: center; }
.flash.notice { background: var(--success-tint); color: var(--success); }
.flash.alert { background: var(--danger-tint); color: var(--danger); }

/* ============ FORMS ============ */
.form { padding: 20px; display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field > label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.form-field .hint { font-size: 12px; color: var(--text-3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tselect { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-md); background: var(--surface-input); border: 1px solid var(--line); color: var(--text); font-size: 13.5px; appearance: none; 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='%236E6E76' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.tselect:focus { outline: none; border-color: var(--focus-ring); box-shadow: var(--accent-glow); }
textarea.tinput { height: auto; padding: 10px 13px; min-height: 76px; resize: vertical; line-height: 1.5; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 4px; }
.errors { background: var(--danger-tint); color: var(--danger); border-radius: var(--r-md); padding: 12px 14px; font-size: 13px; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }
.link-plain { color: var(--accent-text); font-weight: 550; }
.link-plain:hover { color: var(--violet-200); }

/* Checkbox list / permission grid */
.check-line { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; cursor: pointer; }
.check-line .check { margin-top: 1px; }
.check-line .t b { font-weight: 550; font-size: 13.5px; }
.check-line .t span { display: block; font-size: 12px; color: var(--text-3); }
.perm-group { border-top: 1px solid var(--line-faint); padding: 8px 0; }
.perm-group > h4 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 8px 0 4px; }

/* ============ PEOPLE / CARDS ============ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.org-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); display: block; }
.org-card:hover { border-color: var(--line-strong); background: var(--surface-3); }
.org-card .top { display: flex; align-items: center; gap: 12px; }
.org-card .mono-mark { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface-3); display: grid; place-items: center; font-weight: 700; color: var(--text-2); font-size: 15px; flex: none; }
.org-card h3 { font-size: 15px; font-weight: 600; }
.org-card .meta { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.org-card .foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-faint); font-size: 12.5px; color: var(--text-2); }

.avatar-lg { width: 56px; height: 56px; border-radius: var(--r-full); background: linear-gradient(150deg, var(--violet-500), var(--violet-700)); display: grid; place-items: center; font-weight: 700; font-size: 19px; color: #fff; flex: none; }

.badge-role { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 550; background: var(--accent-tint); color: var(--accent-text); white-space: nowrap; }
.badge-role.plain { background: var(--surface-3); color: var(--text-2); }
.badge-role.global::before { content: "◆"; margin-right: 5px; font-size: 8px; }
.role-badges { display: inline-flex; flex-wrap: wrap; gap: 5px; }

/* Definition list (profile) */
.def-list { display: grid; grid-template-columns: 150px 1fr; gap: 0; }
.def-list dt { padding: 12px 0; color: var(--text-3); font-size: 13px; border-bottom: 1px solid var(--line-faint); }
.def-list dd { padding: 12px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-faint); }
.def-list dt:last-of-type, .def-list dd:last-of-type { border-bottom: none; }

/* Invite banner */
.invite-banner { background: var(--accent-tint); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 22px; }
.invite-banner h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.invite-banner p { font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.invite-link { display: flex; gap: 8px; }
.invite-link input { flex: 1; height: 38px; padding: 0 12px; border-radius: var(--r-md); background: var(--surface-input); border: 1px solid var(--line); color: var(--text); font-family: var(--font-mono); font-size: 12px; }

/* Empty state */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty-state svg { width: 40px; height: 40px; stroke-width: 1.3; opacity: .5; margin-bottom: 14px; }
.empty-state h3 { font-size: 15px; color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 340px; margin: 0 auto 18px; }

.section-gap { margin-top: 24px; }
.subtle { color: var(--text-3); font-size: 12.5px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-dot.active { color: var(--success); }
.status-dot.invited { color: var(--warning); }
.status-dot.suspended { color: var(--danger); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .ribbon { grid-template-columns: repeat(2, 1fr); }
  .ribbon .cell:nth-child(2) { border-right: none; }
  .ribbon .cell:nth-child(1), .ribbon .cell:nth-child(2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 20px 18px 48px; }
  .search { width: 100%; }
}
