/* ===== MCB Git-Admin — Design v2 ===== */
:root {
  --brand: #6d5efc;
  --brand-2: #a855f7;
  --brand-3: #ec4899;
  --brand-grad: linear-gradient(135deg, #6d5efc 0%, #a855f7 55%, #ec4899 100%);
  --green: #22c55e; --green-soft: color-mix(in srgb, #22c55e 15%, transparent);
  --amber: #f59e0b; --amber-soft: color-mix(in srgb, #f59e0b 16%, transparent);
  --red: #f43f5e;   --red-soft: color-mix(in srgb, #f43f5e 14%, transparent);
  --r-lg: 20px; --r: 15px; --r-sm: 11px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  font-synthesis: none;
}
/* dark (default) */
:root {
  --bg: #090a10; --bg-glow: rgba(109,94,252,.16);
  --surface: #14161f; --surface-2: #1a1d28; --surface-3: #232634;
  --border: rgba(255,255,255,.08); --border-2: rgba(255,255,255,.05);
  --text: #f1f3f8; --text-2: #bcc4d2; --muted: #7b8496;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.7);
  --ring: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #f5f6fb; --bg-glow: rgba(109,94,252,.14);
  --surface: #ffffff; --surface-2: #f4f5fa; --surface-3: #ebedf4;
  --border: rgba(15,20,45,.09); --border-2: rgba(15,20,45,.06);
  --text: #14161e; --text-2: #465066; --muted: #7a8496;
  --shadow: 0 1px 2px rgba(20,24,40,.05), 0 12px 28px -14px rgba(20,24,40,.22);
  --shadow-lg: 0 26px 60px -18px rgba(20,24,40,.28);
}}
:root[data-theme="light"] {
  --bg: #f5f6fb; --bg-glow: rgba(109,94,252,.14);
  --surface: #ffffff; --surface-2: #f4f5fa; --surface-3: #ebedf4;
  --border: rgba(15,20,45,.09); --border-2: rgba(15,20,45,.06);
  --text: #14161e; --text-2: #465066; --muted: #7a8496;
  --shadow: 0 1px 2px rgba(20,24,40,.05), 0 12px 28px -14px rgba(20,24,40,.22);
  --shadow-lg: 0 26px 60px -18px rgba(20,24,40,.28);
}
:root[data-theme="dark"] {
  --bg: #090a10; --bg-glow: rgba(109,94,252,.16);
  --surface: #14161f; --surface-2: #1a1d28; --surface-3: #232634;
  --border: rgba(255,255,255,.08); --border-2: rgba(255,255,255,.05);
  --text: #f1f3f8; --text-2: #bcc4d2; --muted: #7b8496;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text);
  background:
    radial-gradient(900px 500px at 78% -8%, var(--bg-glow), transparent 60%),
    radial-gradient(700px 420px at 8% 4%, color-mix(in srgb, var(--brand-3) 9%, transparent), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  font-family: system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.45; -webkit-font-smoothing: antialiased; letter-spacing: -0.006em;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82em; }

/* ===== Buttons ===== */
button, .link-btn {
  font-family: inherit; cursor: pointer; border: 1px solid transparent; border-radius: 999px;
  padding: .6rem 1.05rem; font-size: .88rem; font-weight: 600; letter-spacing: -.01em;
  color: #fff; background: var(--brand-grad); background-size: 140% 140%;
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; text-decoration: none;
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), filter .2s, background-position .4s var(--ease);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 60%, transparent);
}
button:hover, .link-btn:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--brand) 65%, transparent); }
button:active { transform: translateY(0); }
button:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.ghost, .link-btn.ghost, .link-btn {
  background: var(--surface-2); color: var(--text); border-color: var(--border); box-shadow: none;
}
.ghost:hover, .link-btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.icon-btn { padding: .55rem .65rem; }
button.sm { padding: .36rem .68rem; font-size: .77rem; }
button.green { background: var(--green); box-shadow: none; }
button.amber { background: var(--amber); box-shadow: none; }
button.red { background: var(--red); box-shadow: none; }
button.soft-green { background: var(--green-soft); color: var(--green); box-shadow: none; }
button.soft-amber { background: var(--amber-soft); color: var(--amber); box-shadow: none; }
button.soft-red   { background: var(--red-soft); color: var(--red); box-shadow: none; }
button.soft-ghost { background: transparent; color: var(--text-2); border-color: var(--border); box-shadow: none; }
button.soft-green:hover, button.soft-amber:hover, button.soft-red:hover, button.soft-ghost:hover { filter: brightness(1.08); transform: translateY(-1px); }

input, select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-sm); padding: .72rem .9rem; font-size: 1rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: var(--ring); }
.err { color: var(--red); font-size: .85rem; margin-top: .6rem; min-height: 1rem; }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
  width: 100%; max-width: 370px; text-align: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--border); border-radius: 24px; padding: 2.4rem 2rem;
  box-shadow: var(--shadow-lg); backdrop-filter: blur(14px); animation: pop .35s var(--ease);
}
.login-card .brand-mark { margin: 0 auto 1rem; width: 52px; height: 52px; font-size: 1.5rem; border-radius: 16px; }
.login-card h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
.login-card input { margin: 1.5rem 0 .9rem; }
.login-card button { width: 100%; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ===== Header ===== */
header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1.5rem; position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .8rem; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-size: 1.2rem; font-weight: 800; flex: none;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--brand) 70%, transparent);
}
img.brand-mark { background: none; border-radius: 0 !important; box-shadow: none; }
.brand h1 { font-size: 1.08rem; margin: 0; letter-spacing: -.02em; font-weight: 750; }
.brand .sub { font-size: .72rem; color: var(--muted); }
.header-actions { display: flex; gap: .5rem; align-items: center; }

/* ===== Layout ===== */
main { max-width: 1260px; margin: 0 auto; padding: 1.6rem 1.5rem 4rem; }
.section-title { font-size: .8rem; font-weight: 700; margin: 0 0 .9rem; display: flex; align-items: center; gap: .55rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.section-title .hint { font-weight: 500; color: var(--muted); font-size: .78rem; text-transform: none; letter-spacing: 0; }
section + section { margin-top: 2.1rem; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: .8rem; margin-bottom: 1.7rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: .95rem 1.1rem; display: flex; align-items: center; gap: .85rem; box-shadow: var(--shadow);
  transition: transform .15s var(--ease), border-color .15s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-2); }
.stat .dot { width: 34px; height: 34px; border-radius: 10px; flex: none; opacity: .9;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.stat .n { font-size: 1.65rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.stat .l { font-size: .74rem; color: var(--muted); margin-top: .15rem; }

/* card wrapper */
.pending-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 1.1rem 1.2rem;
}
.pending-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px,1fr)); gap: .7rem; }
.pending-row {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-sm);
  transition: border-color .15s;
}
.pending-row:hover { border-color: var(--border); }
.pending-row .who { flex: 1; min-width: 0; }
.pending-row .who b { display: block; letter-spacing: -.01em; }
.pending-row .who-sub { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-row .p-actions { display: flex; gap: .35rem; }

/* empty / loading */
.empty { text-align: center; color: var(--muted); padding: 1.8rem 1rem; }
.empty .big { font-size: 2rem; display: block; margin-bottom: .35rem; opacity: .85; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 40%, transparent); backdrop-filter: blur(2px); z-index: 90; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Board ===== */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px,1fr)); gap: 1.1rem; align-items: start; }
.col {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
  transition: box-shadow .2s var(--ease), transform .15s var(--ease);
  animation: pop .3s var(--ease) both;
}
.col::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent, var(--brand)); opacity: .9; }
.col-head { padding: .95rem 1.1rem .85rem; display: flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: -.01em; }
.col-head .swatch { width: 9px; height: 9px; border-radius: 50%; background: var(--accent, var(--brand)); box-shadow: 0 0 10px var(--accent, var(--brand)); }
.col-head .cnt { margin-left: auto; font-weight: 700; color: var(--text-2); font-size: .74rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .12rem .6rem; }
.col-body { padding: .7rem; display: flex; flex-direction: column; gap: .55rem; min-height: 92px; }
.col.drop-hover { box-shadow: var(--shadow), 0 0 0 2px var(--accent, var(--brand)), 0 0 0 6px color-mix(in srgb, var(--accent, var(--brand)) 18%, transparent); transform: translateY(-2px); }
.col-empty { color: var(--muted); font-size: .8rem; text-align: center; padding: 1.3rem .5rem; border: 1.5px dashed var(--border); border-radius: var(--r-sm); }

/* user card */
.user-card {
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-sm);
  padding: .65rem .7rem; cursor: grab;
  transition: box-shadow .15s var(--ease), transform .1s var(--ease), border-color .15s;
}
.user-card:hover { border-color: var(--border); box-shadow: var(--shadow); transform: translateY(-1px); }
.user-card:active { cursor: grabbing; }
.user-card.dragging { opacity: .4; transform: scale(.97) rotate(-1deg); }
.user-card.blocked { opacity: .68; }
.u-top { display: flex; align-items: center; gap: .65rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: .82rem; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 3px 8px -3px rgba(0,0,0,.5);
}
.avatar.lg { width: 44px; height: 44px; font-size: .95rem; border-radius: 13px; }
.u-info { min-width: 0; flex: 1; }
.u-name { font-weight: 650; display: flex; align-items: center; gap: .4rem; letter-spacing: -.01em; }
.u-name .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-mail { color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: .61rem; font-weight: 800; padding: .12rem .45rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.tag.admin { background: color-mix(in srgb, var(--brand) 20%, transparent); color: color-mix(in srgb, var(--brand) 82%, #fff); }
.tag.blocked { background: var(--red-soft); color: var(--red); }
.u-actions { display: flex; gap: .3rem; margin-top: .6rem; flex-wrap: wrap; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .22s var(--ease), opacity .18s var(--ease), margin-top .2s; margin-top: 0; }
.user-card:hover .u-actions, .user-card:focus-within .u-actions { max-height: 60px; opacity: 1; margin-top: .6rem; }
@media (hover: none) { .u-actions { max-height: 60px; opacity: 1; margin-top: .6rem; } }

/* ===== Toolbar / Filter ===== */
.toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: 1.1rem; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 170px; max-width: 330px; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { padding: .46rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .15s var(--ease); }
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.active { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 5px 14px -6px color-mix(in srgb, var(--brand) 60%, transparent); }

/* ===== Modal ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6,8,14,.6); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 80; padding: 1rem; animation: fade .18s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 470px; padding: 1.6rem 1.7rem; animation: pop .24s var(--ease); }
.modal h3 { margin: 0 0 .25rem; font-size: 1.15rem; letter-spacing: -.02em; }
.modal .row { display: flex; gap: .8rem; }
.modal label { font-size: .74rem; color: var(--muted); display: block; margin: 1rem 0 .35rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.modal .actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.5rem; }
.invite-link { display: flex; gap: .45rem; margin-top: 1rem; padding: .6rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.invite-link input { font-family: ui-monospace, "SF Mono", monospace; font-size: .8rem; background: transparent; border: none; padding: .35rem .4rem; }
.invite-link input:focus { box-shadow: none; }
.invite-item { display: flex; align-items: center; gap: .5rem; padding: .55rem .65rem; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-sm); margin-top: .5rem; font-size: .82rem; }
.invite-item .meta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-pick { display: flex; gap: .7rem; margin-top: 1.2rem; }
.role-pick button { flex: 1; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .95rem 1rem; text-align: left; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.role-pick button:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); background: var(--surface-3); }
.role-pick button b { font-size: .95rem; }
.role-pick button .small { font-weight: 500; color: var(--muted); }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: .8rem 1.2rem; border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 100; max-width: 92vw; display: flex; align-items: center; gap: .6rem; font-weight: 500; animation: toastin .3s var(--ease); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.toast.err-toast::before { background: var(--red); box-shadow: 0 0 10px var(--red); }
@keyframes toastin { from { transform: translateX(-50%) translateY(14px); opacity: 0; } }

@media (max-width: 560px) {
  .brand .sub { display: none; }
  main { padding: 1.1rem 1rem 3rem; }
  .header-actions .link-btn { display: none; }
}
