/* ============================================================
   SETTINGS / ADMIN styles
   ============================================================ */
.settings-wrap { display: flex; min-height: 100vh; background: var(--bg); color: var(--fg); }
.settings-side { width: 240px; flex-shrink: 0; border-right: 1px solid var(--line-soft); padding: 24px 16px; display: flex; flex-direction: column; gap: 2px; background: var(--bg-1); }
.settings-side h4 { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-4); margin: 18px 8px 8px; }
.settings-side .nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--fg-2); font-size: 13px; cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; }
.settings-side .nav-item:hover { background: var(--bg-3); color: var(--fg); }
.settings-side .nav-item[data-active="true"] { background: var(--bg-3); color: var(--fg); font-weight: 600; }
.settings-side .back { font-size: 11.5px; color: var(--fg-3); padding: 6px 8px; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.settings-side .back:hover { color: var(--fg); }
.settings-side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }
.settings-side .brand .logo { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, oklch(72% 0.16 30), oklch(55% 0.18 10)); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 11px; font-family: var(--font-mono); }
.settings-side .brand .meta { display: flex; flex-direction: column; line-height: 1.1; }
.settings-side .brand .meta .name { font-size: 13px; font-weight: 600; color: var(--fg); }
.settings-side .brand .meta .plan { font-size: 10px; font-family: var(--font-mono); color: var(--fg-4); letter-spacing: 0.06em; text-transform: uppercase; }

.settings-main { flex: 1; padding: 40px 48px 80px; max-width: 1080px; margin: 0 auto; }
.settings-hdr { margin-bottom: 28px; }
.settings-hdr .kicker { font-size: 10.5px; font-family: var(--font-mono); color: var(--fg-4); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.settings-hdr h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg); margin: 0 0 6px; }
.settings-hdr .sub { font-size: 13px; color: var(--fg-3); }

.settings-card { background: var(--bg-1); border: 1px solid var(--line-soft); border-radius: 10px; padding: 20px 22px; margin-bottom: 18px; }
.settings-card h2 { font-size: 14px; font-weight: 600; color: var(--fg); margin: 0 0 4px; letter-spacing: -0.01em; }
.settings-card .desc { font-size: 12px; color: var(--fg-3); margin: 0 0 16px; }
.settings-card.row { display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.settings-card.row .text { flex: 1; }
.settings-card.row .text h3 { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.settings-card.row .text p  { font-size: 12px; color: var(--fg-3); margin: 0; }

.stt-table { width: 100%; border-collapse: collapse; }
.stt-table th { text-align: left; font-size: 10px; font-weight: 600; color: var(--fg-4); text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.stt-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
.stt-table tr:last-child td { border-bottom: none; }
.stt-table tr:hover td { background: var(--bg-2); }
.stt-table .avatar { width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 10.5px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.stt-table .name-cell { display: flex; align-items: center; gap: 10px; }
.stt-table .name-cell .n { font-weight: 600; color: var(--fg); }
.stt-table .name-cell .e { font-size: 11.5px; color: var(--fg-4); }
.role-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: var(--bg-2); color: var(--fg-2); cursor: pointer; }
.role-pill[data-role="Owner"]  { background: color-mix(in oklch, oklch(72% 0.16 60) 22%, var(--bg-1)); border-color: color-mix(in oklch, oklch(72% 0.16 60) 40%, var(--line)); color: oklch(80% 0.14 60); }
.role-pill[data-role="Admin"]  { background: color-mix(in oklch, oklch(72% 0.14 260) 22%, var(--bg-1)); border-color: color-mix(in oklch, oklch(72% 0.14 260) 40%, var(--line)); color: oklch(80% 0.13 260); }
.role-pill[data-role="Member"] { }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.access-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: var(--bg-2); color: var(--fg-2); }
.access-pill[data-access="private"] { color: oklch(70% 0.1 60); border-color: color-mix(in oklch, oklch(70% 0.1 60) 35%, var(--line)); background: color-mix(in oklch, oklch(70% 0.1 60) 12%, var(--bg-1)); }
.access-pill[data-access="shared"] { color: oklch(78% 0.14 150); border-color: color-mix(in oklch, oklch(78% 0.14 150) 35%, var(--line)); background: color-mix(in oklch, oklch(78% 0.14 150) 12%, var(--bg-1)); }

.seat-bar { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; margin: 10px 0 4px; }
.seat-bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); }
.plan-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-top: 12px; }
.plan-stat { padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--bg-2); }
.plan-stat .k { font-size: 10.5px; font-family: var(--font-mono); color: var(--fg-4); letter-spacing: 0.06em; text-transform: uppercase; }
.plan-stat .v { font-size: 18px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }
.plan-stat .sub { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; }

.inv-row { display: grid; grid-template-columns: 1fr 1fr 120px 120px 40px; align-items: center; font-size: 12.5px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
.inv-row.head { font-size: 10px; text-transform: uppercase; color: var(--fg-4); letter-spacing: 0.06em; font-weight: 600; border-bottom: 1px solid var(--line); padding: 6px 2px; }
.inv-row .pay-status { display: inline-flex; align-items: center; gap: 5px; color: oklch(78% 0.14 150); font-size: 11.5px; font-weight: 600; }
.inv-row:last-child { border-bottom: none; }

.perm-grid { border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; margin-top: 8px; }
.perm-grid .perm-row { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); align-items: center; font-size: 12.5px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.perm-grid .perm-row:last-child { border-bottom: none; }
.perm-grid .perm-row.head { background: var(--bg-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-4); font-weight: 600; }
.perm-grid .perm-row .cell { text-align: center; }
.perm-grid .perm-row .cell[data-yes="true"]  { color: oklch(78% 0.14 150); }
.perm-grid .perm-row .cell[data-yes="false"] { color: var(--fg-4); }
.perm-grid .perm-row .label { color: var(--fg-2); }

.perm-cell-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; display: inline-flex; align-items: center; justify-content: center;
  cursor: default; padding: 0; margin: 0 auto;
  transition: background 0.12s, border-color 0.12s;
}
.perm-cell-btn:disabled { opacity: 1; cursor: not-allowed; }
.perm-cell-btn.editable { cursor: pointer; border-color: var(--line-soft); }
.perm-cell-btn.editable:hover { background: var(--bg-3); border-color: var(--fg-4); }
.perm-cell-btn.editable.on { background: color-mix(in oklch, oklch(78% 0.14 150) 10%, transparent); border-color: color-mix(in oklch, oklch(78% 0.14 150) 40%, transparent); }
.perm-cell-btn.editable.on:hover { background: color-mix(in oklch, oklch(78% 0.14 150) 18%, transparent); }

.chip-btn.primary {
  background: var(--fg-1); color: var(--bg-1); border-color: var(--fg-1);
}
.chip-btn.primary:hover { opacity: 0.9; }

.ws-row { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.ws-row:last-child { border-bottom: none; }
.ws-row:hover { background: var(--bg-2); }
.ws-row .ws-icon { width: 32px; height: 32px; border-radius: 7px; background: var(--bg-3); display: inline-flex; align-items: center; justify-content: center; color: var(--fg-2); margin-right: 14px; }
.ws-row .ws-name { font-size: 13px; font-weight: 600; color: var(--fg); }
.ws-row .ws-meta { font-size: 11.5px; color: var(--fg-4); margin-top: 2px; }
.ws-row .ws-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.avatar-stack { display: inline-flex; }
.avatar-stack .a { width: 22px; height: 22px; border-radius: 999px; color: white; font-size: 9.5px; font-weight: 600; font-family: var(--font-mono); display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg-1); margin-left: -6px; }
.avatar-stack .a:first-child { margin-left: 0; }
.avatar-stack .more { background: var(--bg-3); color: var(--fg-3); }

/* Invite modal link chip */
.invite-link-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; font-family: var(--font-mono); font-size: 11.5px; background: var(--bg-2); color: var(--fg-2); margin-top: 10px; }
.invite-link-chip .code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip-btn { font-size: 11px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); color: var(--fg-2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.chip-btn:hover { background: var(--bg-3); color: var(--fg); }
.chip-btn.danger { color: oklch(72% 0.17 25); border-color: color-mix(in oklch, oklch(72% 0.17 25) 30%, var(--line)); }
.chip-btn.danger:hover { background: color-mix(in oklch, oklch(72% 0.17 25) 12%, var(--bg-1)); }
.chip-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.chip-btn.primary:hover { background: color-mix(in oklch, var(--accent) 85%, white); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.seg button { padding: 6px 12px; font-size: 12px; color: var(--fg-3); background: transparent; border: none; cursor: pointer; }
.seg button[data-active="true"] { background: var(--bg-3); color: var(--fg); font-weight: 600; }

/* Toggle switch */
.toggle { width: 34px; height: 20px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background 0.15s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px; background: var(--fg-3); transition: transform 0.15s, background 0.15s; }
.toggle[data-on="true"] { background: color-mix(in oklch, var(--accent) 30%, var(--bg-3)); border-color: var(--accent); }
.toggle[data-on="true"]::after { transform: translateX(14px); background: var(--accent); }
