/* SOTECH Company Hub */
:root {
  --bg: #0A0C13; --bg-2: #0E111C; --surface: #121626; --surface-2: #181D31; --surface-3: #20263F;
  --border: rgba(150, 165, 255, .09); --border-strong: rgba(150, 165, 255, .17);
  --text: #E9ECF8; --muted: #8C93AE; --faint: #5E6582;
  --accent: #7C5CFF; --accent-2: #22D3EE; --grad: linear-gradient(135deg, #7C5CFF 0%, #4F7BFF 52%, #22D3EE 100%);
  --green: #22C55E; --red: #F43F5E; --amber: #F59E0B; --cyan: #22D3EE; --violet: #8B5CF6; --rose: #FB7185;
  --shadow: 0 16px 40px -18px rgba(0, 0, 0, .65); --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .7);
  --r: 18px; --r-sm: 12px; --ease: cubic-bezier(.2, .8, .2, 1);
  --glow-1: rgba(124, 92, 255, .16); --glow-2: rgba(34, 211, 238, .09);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F3F5FB; --bg-2: #ECEFF7; --surface: #FFFFFF; --surface-2: #F5F7FC; --surface-3: #E9EDF7;
  --border: rgba(25, 35, 90, .08); --border-strong: rgba(25, 35, 90, .15);
  --text: #12162A; --muted: #5C6382; --faint: #9AA0B8;
  --shadow: 0 14px 34px -18px rgba(30, 40, 100, .22); --shadow-lg: 0 30px 70px -24px rgba(30, 40, 100, .3);
  --glow-1: rgba(124, 92, 255, .10); --glow-2: rgba(34, 211, 238, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg);
  background-image: radial-gradient(900px 500px at 85% -10%, var(--glow-1), transparent 60%), radial-gradient(700px 420px at 10% 0%, var(--glow-2), transparent 60%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.spacer { flex: 1; }
.ic { flex: none; display: block; }
b.g { color: var(--green); }

/* ---------- boot / login ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { width: 64px; animation: pulse 1.4s var(--ease) infinite; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; }
.orb.o1 { width: 420px; height: 420px; background: #7C5CFF; top: -120px; right: -80px; animation: float 12s ease-in-out infinite; }
.orb.o2 { width: 360px; height: 360px; background: #22D3EE; bottom: -140px; left: -90px; opacity: .35; animation: float 14s ease-in-out infinite reverse; }
.login-card {
  position: relative; width: 100%; max-width: 400px; padding: 36px 32px 30px; border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border-strong);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 14px; animation: rise .6s var(--ease) both;
}
.login-logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 14px 40px -8px rgba(124, 92, 255, .6); }
.login-card h1 { font-size: 30px; font-weight: 800; letter-spacing: .14em; margin-top: 6px; }
.login-card > p { margin-top: -10px; margin-bottom: 8px; }
.login-foot { position: absolute; bottom: 18px; color: var(--faint); font-size: 12px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 256px; z-index: 40; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 14px 16px; background: color-mix(in srgb, var(--bg-2) 88%, transparent); border-right: 1px solid var(--border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: transform .35s var(--ease);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 18px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 10px 26px -8px rgba(124, 92, 255, .7); }
.brand b { display: block; font-size: 18px; font-weight: 800; letter-spacing: .16em; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; margin-top: -2px; letter-spacing: .02em; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 600; transition: background .2s, color .2s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { color: var(--text); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 4%, transparent)); }
.nav-item.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.nav-item.active .ic { color: var(--accent); }
[data-theme="dark"] .nav-item.active .ic { color: #A994FF; }
.nav-item .lock { margin-left: auto; color: var(--amber); opacity: .85; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; }
.me-card b { display: block; font-size: 13.5px; line-height: 1.25; }
.me-card small { color: var(--muted); font-size: 12px; }

.main { margin-left: 256px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 70px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page { padding: 26px 28px 60px; max-width: 1360px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.page.enter > * { animation: rise .5s var(--ease) both; }
.page.enter > *:nth-child(2) { animation-delay: .04s; }
.page.enter > *:nth-child(3) { animation-delay: .08s; }
.page.enter > *:nth-child(4) { animation-delay: .12s; }
.page.enter > *:nth-child(n+5) { animation-delay: .16s; }
.scrim { display: none; }
.only-mobile { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s, border-color .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(91, 110, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 14px 30px -10px rgba(91, 110, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .25); transform: translateY(-1px); }
.btn.ghost { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 10px 24px -10px rgba(244, 63, 94, .8); }
.btn.danger-ghost { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.btn.danger-ghost:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; height: 48px; font-size: 15px; margin-top: 6px; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; transition: background .2s, color .2s, transform .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; background: transparent; border-color: transparent; }
.icon-btn.sm:hover { background: var(--surface-3); }
.icon-btn.danger:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }

.field { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field em { font-style: normal; color: var(--faint); font-weight: 500; }
.field input, .field select, .field textarea, .input, .select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2);
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { height: auto; padding: 11px 14px; resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus, .input-affix:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field input[type="color"] { padding: 4px; cursor: pointer; }
.select { width: auto; min-width: 180px; cursor: pointer; }
.input-affix { display: flex; align-items: center; height: 44px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); transition: border-color .2s, box-shadow .2s; }
.input-affix input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 14px; outline: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.input-affix span { padding: 0 14px 0 4px; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.input-affix.lg { height: 56px; }
.input-affix.lg input { font-size: 22px; }
input[type="number"]::-webkit-inner-spin-button { opacity: .4; }
.form-error { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--rose); font-weight: 600; font-size: 13px; border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); }
.form-error[hidden] { display: none; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card.glow { position: relative; overflow: hidden; }
.card.glow::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 220px at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); pointer-events: none; }
.card.glow > * { position: relative; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 15.5px; font-weight: 700; }
.card-head .link { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; transition: color .2s; }
.card-head .link:hover { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin-top: 4px; }
.page-head > :last-child:not(:first-child) { margin-left: auto; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 6px 0 6px; }
.big .money small { font-size: 16px; }

.hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 26px; }
.hero h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; }
.hero-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; transition: transform .25s var(--ease), border-color .25s; }
.kpi:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--tone); opacity: .1; filter: blur(10px); }
.kpi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); margin-bottom: 10px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.kpi-sub { font-size: 12.5px; color: var(--faint); }
.tone-violet { --tone: var(--violet); } .tone-rose { --tone: var(--rose); } .tone-cyan { --tone: var(--cyan); }
.tone-green { --tone: var(--green); } .tone-amber { --tone: var(--amber); }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.money small { margin-left: 4px; font-size: .62em; font-weight: 700; color: var(--faint); letter-spacing: .04em; }
.money.neg { color: var(--red); }
.money.pos { color: var(--green); }
.money.strong { font-weight: 800; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--muted); letter-spacing: .02em; }
.badge.admin { background: color-mix(in srgb, var(--accent) 18%, transparent); color: #A994FF; }
[data-theme="light"] .badge.admin { color: var(--accent); }
.badge.private { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.badge.in { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.badge.out { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--rose); }

.avatar {
  flex: none; display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #1a1040)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.avatar.ghost { background: var(--surface-3); color: var(--muted); }

/* ---------- lamp ---------- */
.lamp {
  --lc: var(--green); display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 11px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lc) 35%, transparent); background: color-mix(in srgb, var(--lc) 9%, var(--surface));
  font-weight: 700; font-size: 13px; cursor: pointer; transition: background .3s, border-color .3s, transform .15s;
}
.lamp.off { --lc: var(--red); }
.lamp:active:not(:disabled) { transform: scale(.95); }
.lamp:disabled { cursor: default; }
.lamp.mini { height: 30px; width: 30px; padding: 0; justify-content: center; background: transparent; border-color: transparent; }
.lamp.mini:not(:disabled):hover { background: color-mix(in srgb, var(--lc) 12%, transparent); }
.bulb {
  width: 14px; height: 14px; border-radius: 50%; flex: none; transition: background .3s, box-shadow .3s;
  background: radial-gradient(circle at 35% 30%, #fff 0 10%, var(--lc) 45%, color-mix(in srgb, var(--lc) 55%, #000) 100%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 18%, transparent), 0 0 14px 2px color-mix(in srgb, var(--lc) 65%, transparent);
}
.lamp.on .bulb, .lamp-switch.on .bulb { animation: glow 2.6s ease-in-out infinite; }
.lamp-switch {
  --lc: var(--green); width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; text-align: left;
  border: 1px solid color-mix(in srgb, var(--lc) 30%, transparent); background: color-mix(in srgb, var(--lc) 8%, var(--surface-2)); cursor: pointer;
  transition: background .3s, border-color .3s;
}
.lamp-switch.off { --lc: var(--red); }
.lamp-switch:disabled { cursor: default; }
.lamp-switch .bulb { width: 20px; height: 20px; }
.lamp-switch b { display: block; font-size: 14px; }
.lamp-switch small { display: block; font-size: 12px; color: var(--muted); }
.switch { margin-left: auto; width: 46px; height: 26px; border-radius: 99px; background: color-mix(in srgb, var(--lc) 70%, #000); position: relative; transition: background .3s; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.lamp-switch.on .switch i { transform: translateX(20px); }

/* ---------- lists ---------- */
.people { display: flex; flex-direction: column; gap: 6px; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; transition: background .2s; }
.person-row:hover { background: var(--surface-2); }
.person-row b { display: block; font-size: 14px; }
.person-row small { display: block; color: var(--muted); font-size: 12px; }
.person-row .pill { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.stack i { width: var(--w); background: var(--c); transition: width .6s var(--ease); min-width: 3px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 18px; }
.legend div { display: flex; flex-direction: column; gap: 2px; }
.legend span { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend span::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.legend .money { font-size: 17px; }
.warn { margin-top: 16px; padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--amber); }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row .bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 6px; }
.bar-row .bar-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: var(--grad); transition: width .6s var(--ease); }

.mini-tasks { display: flex; flex-direction: column; gap: 8px; }
.mini-task { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; transition: border-color .2s, transform .2s; }
.mini-task:hover { border-color: var(--border-strong); transform: translateX(2px); }
.mini-task b { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-item p { font-size: 13.5px; }
.feed-item p b { font-weight: 700; }
.feed-item small { color: var(--faint); font-size: 12px; }
.feed-item .badge { margin-left: 6px; height: 20px; font-size: 10.5px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); margin-bottom: 6px; }
.empty h4 { color: var(--text); font-size: 15px; }
.empty .btn { margin-top: 10px; }

/* ---------- tables ---------- */
.chips { display: flex; gap: 12px; flex-wrap: wrap; }
.chip-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 150px; }
.chip-stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip-stat b, .chip-stat .money { font-size: 19px; font-weight: 800; }
.table-card { padding: 0; overflow: hidden; }
.table-tools { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--faint); flex: 1; max-width: 360px; }
.search:focus-within { border-color: var(--accent); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--text); }
.table-wrap { overflow-x: auto; }
.table .nowrap { white-space: nowrap; }
@media (max-width: 1280px) {
  .table .col-by { display: none; }
  .table th, .table td { padding-left: 10px; padding-right: 10px; }
  .table .cell-title small { max-width: 170px; }
}
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 12px 16px; background: var(--surface-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table .r { text-align: right; }
.table tfoot td { font-weight: 800; background: var(--surface-2); }
.cell-title b { display: block; font-weight: 700; }
.cell-title small { display: block; color: var(--muted); font-size: 12.5px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.actions { text-align: right; white-space: nowrap; width: 1%; }
.actions .icon-btn { display: inline-grid; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--accent-2) 13%, transparent); color: var(--cyan); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="light"] .tag { color: #0E8DA6; }
.tag.muted { background: var(--surface-3); color: var(--muted); }

/* ---------- task board ---------- */
.board-hint { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 16px; overflow-x: auto; padding: 2px 2px 14px; scroll-snap-type: x proximity; }
.board-col {
  display: flex; flex-direction: column; min-height: 460px; border-radius: 20px; background: color-mix(in srgb, var(--surface) 55%, transparent);
  border: 1.5px solid var(--border); transition: border-color .2s, box-shadow .2s, background .2s; scroll-snap-align: start;
}
.board-col.busy { background-image: repeating-linear-gradient(-45deg, transparent 0 11px, color-mix(in srgb, var(--red) 5%, transparent) 11px 22px); }
.board-col.drop-ok { border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent); background-color: color-mix(in srgb, var(--green) 5%, transparent); }
.board-col.drop-no { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 14%, transparent); }
.col-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--border); }
.col-title { min-width: 0; flex: 1; }
.col-title b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-title small { display: block; font-size: 11.5px; color: var(--muted); }
.board-col.busy .col-title small { color: var(--rose); }
.count { min-width: 26px; height: 22px; padding: 0 8px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--muted); }
.col-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.col-empty { flex: 1; display: grid; place-items: center; min-height: 120px; border: 1.5px dashed var(--border-strong); border-radius: 14px; color: var(--faint); font-size: 13px; font-weight: 600; }
.task-card {
  position: relative; padding: 13px 14px 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong);
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .4);
  transition: transform .18s var(--ease), box-shadow .18s, opacity .18s, border-color .18s; overflow: hidden;
}
.task-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pc, var(--faint)); }
.task-card.prio-high { --pc: var(--red); } .task-card.prio-normal { --pc: var(--accent); } .task-card.prio-low { --pc: var(--faint); }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .5); border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); }
.task-card.is-done .tc-title { text-decoration: line-through; color: var(--muted); }
.task-card.drag-source { opacity: .3; transform: scale(.98); }
.drag-ghost { position: fixed !important; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0; box-shadow: 0 28px 60px -12px rgba(0, 0, 0, .55) !important; border-color: var(--accent) !important; transition: none !important; will-change: transform; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none !important; }
.tc-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.tc-title { font-weight: 700; font-size: 14px; line-height: 1.35; word-break: break-word; }
.tc-desc { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.tc-meta .overdue { color: var(--red); }
.status { height: 22px; padding: 0 9px; border-radius: 7px; border: 0; font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: filter .2s, transform .15s; }
.status:hover { filter: brightness(1.15); }
.status:active { transform: scale(.94); }
.s-todo { background: var(--surface-3); color: var(--muted); }
.s-doing { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.s-done { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c); }

/* ---------- profits & treasury ---------- */
.split-head, .vault { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.split-head > div:first-child { flex: 1; min-width: 260px; }
.split-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.split-rows { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 18px; }
.split-row { display: grid; grid-template-columns: auto 1fr 70px minmax(160px, 240px); align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.split-row b { display: block; font-size: 14px; }
.split-row small { color: var(--muted); font-size: 12px; }
.sr-pct { text-align: right; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.split-foot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.split-foot .input { flex: 1; min-width: 200px; }
.split-sum { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.split-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.split-sum .neg b { color: var(--red); }
.payouts { display: flex; flex-direction: column; gap: 10px; }
.payout { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.payout-main { min-width: 160px; }
.payout-main b { display: block; }
.payout-main small { color: var(--muted); font-size: 12px; }
.shares { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.share { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; }
.share .money { font-size: 12.5px; }
.vault-main { flex: 1; min-width: 260px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.vault-main .badge { margin-bottom: 10px; }
.vault-form { flex: 1; min-width: 280px; max-width: 460px; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--surface-3); gap: 4px; }
.seg button { height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .4); }
.hint { font-size: 12.5px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
.row .btn.primary { flex: 1; }

/* ---------- team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.member { display: flex; flex-direction: column; gap: 16px; transition: transform .25s var(--ease); }
.member:hover { transform: translateY(-3px); }
.member-top { display: flex; align-items: center; gap: 14px; }
.member-top h3 { font-size: 16.5px; font-weight: 800; }
.member-top p { font-size: 13px; margin-bottom: 6px; }
.member-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.member-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.member-stats b, .member-stats .money { font-size: 16px; font-weight: 800; }
.member-stats small { font-size: 11.5px; color: var(--muted); }
.member-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.settings-grid form { display: flex; flex-direction: column; gap: 14px; }
.settings-grid form .btn { align-self: flex-start; }

/* ---------- modal & toast ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5, 7, 14, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(14px) scale(.98); transition: transform .3s var(--ease);
}
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 22px 6px; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 14px 22px; display: flex; flex-wrap: wrap; gap: 14px; }
.modal-body .field.half { width: calc(50% - 7px); }
.modal-body .form-error { width: 100%; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 8px 22px 22px; flex-wrap: wrap; }
.confirm-text { color: var(--muted); }
.confirm-text b { color: var(--text); }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.5px; max-width: 380px; transform: translateY(16px); opacity: 0; transition: transform .3s var(--ease), opacity .3s;
}
.toast.show { transform: none; opacity: 1; }
.toast .ic { color: var(--green); }
.toast.err .ic { color: var(--red); }

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }
@keyframes float { 50% { transform: translate(30px, 40px) scale(1.08); } }
@keyframes glow { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--lc) 10%, transparent), 0 0 22px 5px color-mix(in srgb, var(--lc) 55%, transparent); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .shell.menu-open .sidebar { transform: none; }
  .shell.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(5, 7, 14, .5); backdrop-filter: blur(3px); }
  .main { margin-left: 0; }
  .only-mobile { display: inline-grid !important; }
  .topbar { padding: 0 16px; height: 62px; }
  .topbar h1 { font-size: 17px; }
  .page { padding: 18px 16px 50px; gap: 16px; }
  .lamp .lamp-text { display: none; }
  .lamp:not(.mini) { padding: 0 12px; }
}
@media (max-width: 760px) {
  .hero { padding: 20px; }
  .hero-actions { margin-left: 0; width: 100%; }
  .hero-actions .btn { flex: 1; }
  .page-head h2 { font-size: 22px; }
  .page-head > :last-child:not(:first-child) { margin-left: 0; }
  .big { font-size: 32px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 21px; }
  .table thead { display: none; }
  .table, .table tbody, .table tfoot, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-top: 1px solid var(--border); position: relative; }
  .table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--faint); font-size: 12px; font-weight: 600; text-align: left; }
  .table td:first-child { text-align: left; padding-right: 70px; }
  .table td:first-child::before { display: none; }
  .table td.actions { position: absolute; top: 8px; right: 8px; width: auto; padding: 0; }
  .table td.actions::before, .table tfoot td:empty { display: none; }
  .split-row { grid-template-columns: auto 1fr auto; }
  .split-row .input-affix { grid-column: 1 / -1; }
  .modal-body .field.half { width: 100%; }
  .board { grid-auto-columns: 84%; }
  #toasts { left: 16px; right: 16px; align-items: stretch; }
  .toast { max-width: none; }
}
