:root {
  --bg: #FAFAFA; --fg: #0F172A; --muted: #F1F5F9; --muted-fg: #64748B;
  --accent: #0052FF; --accent2: #4D7CFF; --border: #E2E8F0; --card: #FFFFFF;
  --grad: linear-gradient(135deg, #0052FF, #4D7CFF);
  --sh-md: 0 4px 6px rgba(0,0,0,.07); --sh-lg: 0 10px 15px rgba(0,0,0,.08); --sh-xl: 0 20px 25px rgba(0,0,0,.1);
  --sh-acc: 0 4px 14px rgba(0,82,255,.25); --sh-acc-lg: 0 8px 24px rgba(0,82,255,.35);
  --font: "Inter", system-ui, sans-serif; --display: "Calistoga", Georgia, serif; --mono: "JetBrains Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted-fg); }
.display { font-family: var(--display); font-weight: 400; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.grad { background: linear-gradient(to right, #0052FF, #4D7CFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1.display { font-size: 2.6rem; } h2.display { font-size: 2rem; }
a { color: var(--accent); cursor: pointer; text-decoration: none; }

/* badge */
.badge { display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(0,82,255,.3); background: rgba(0,82,255,.05); border-radius: 999px; padding: 6px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(1.3); opacity: .7 } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--fg); font: 500 14px var(--font); cursor: pointer; transition: all .2s ease-out; }
.btn:hover { background: var(--muted); border-color: rgba(0,82,255,.3); box-shadow: var(--sh-md); transform: translateY(-2px); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.btn.primary:hover { box-shadow: var(--sh-acc-lg); filter: brightness(1.1); }
.btn.primary .arrow { transition: transform .2s; } .btn.primary:hover .arrow { transform: translateX(4px); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.danger:hover { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.ghost { color: var(--muted-fg); font-size: 13px; } .ghost:hover { color: var(--fg); }

/* inputs */
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted-fg); margin-bottom: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--fg); font: 400 14px var(--font); outline: none; transition: box-shadow .2s, border-color .2s; }
textarea { height: auto; min-height: 110px; padding: 10px 14px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,82,255,.18); }
.error { color: #dc2626; font-size: 13px; min-height: 1.2em; margin: 0 0 8px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 0.9fr 1.1fr; }
.login-art { position: relative; background: var(--fg); overflow: hidden; }
.login-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 30%, rgba(0,82,255,.25), transparent 55%); }
.dots { position: absolute; inset: 0; background-image: radial-gradient(circle, #fff 1px, transparent 1px); background-size: 32px 32px; opacity: .04; pointer-events: none; }
.ring { position: absolute; width: 420px; height: 420px; left: 50%; top: 50%; margin: -210px 0 0 -210px; border: 1.5px dashed rgba(255,255,255,.25); border-radius: 50%; animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.float-card { position: absolute; background: #fff; border-radius: 14px; padding: 14px 18px; box-shadow: var(--sh-xl); color: var(--fg); animation: bob 5s ease-in-out infinite; }
.float-card .mono { display: block; color: var(--muted-fg); font-size: 10px; } .float-card strong { font-size: 22px; }
.fc1 { left: 18%; top: 32%; } .fc2 { right: 16%; top: 56%; animation-duration: 4s; animation-delay: -1.5s; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.corner { position: absolute; right: 0; bottom: 0; width: 120px; height: 120px; background: var(--accent); border-top-left-radius: 4rem; box-shadow: var(--sh-acc-lg); }
.login-box { align-self: center; justify-self: center; width: min(420px, 90vw); padding: 40px 0; }
.login-box h1 { margin: 18px 0 8px; } .login-box p.muted { margin: 0 0 28px; }
.login-box .btn { width: 100%; height: 50px; margin-top: 6px; }

/* app layout */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--fg); color: rgba(255,255,255,.9); padding: 28px 18px; display: flex; flex-direction: column; overflow: hidden; }
.side::after { content: ""; position: absolute; left: -120px; bottom: -120px; width: 320px; height: 320px; background: var(--accent); filter: blur(150px); opacity: .25; pointer-events: none; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 30px; position: relative; z-index: 1; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: #fff; box-shadow: var(--sh-acc); }
.brand-name { font-family: var(--display); font-size: 20px; line-height: 1.1; } .brand-sub { font-size: 10px; color: rgba(255,255,255,.5); }
nav { flex: 1; position: relative; z-index: 1; }
.nav-group { color: rgba(255,255,255,.35); font-size: 10px; margin: 18px 12px 6px; }
nav a { display: block; padding: 9px 12px; border-radius: 10px; color: rgba(255,255,255,.7); font-size: 14px; font-weight: 500; transition: all .2s; }
nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
nav a.active { background: rgba(0,82,255,.25); color: #fff; box-shadow: inset 2px 0 0 var(--accent2); }
.side-user { display: flex; gap: 12px; align-items: center; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); position: relative; z-index: 1; font-size: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 600; color: #fff; }
.main { padding: 40px 48px 80px; max-width: 1200px; width: 100%; }
.menu-btn { display: none; }

/* page pieces */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h2 { margin: 12px 0 4px; } .page-head p { margin: 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar label { margin: 0; display: flex; align-items: center; gap: 8px; } .toolbar input, .toolbar select { margin: 0; width: auto; height: 40px; }
.grid { display: grid; gap: 20px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: var(--sh-md); transition: box-shadow .3s, transform .3s; position: relative; overflow: hidden; }
.card:hover { box-shadow: var(--sh-xl); }
.card.hover-lift:hover { transform: translateY(-3px); }
.card h3 { margin: 0 0 12px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.stat .mono { color: var(--muted-fg); font-size: 11px; }
.stat .num { font-family: var(--display); font-size: 2rem; margin-top: 6px; line-height: 1.1; }
.stat .sub { font-size: 12px; color: var(--muted-fg); margin-top: 6px; }
.stat.dark { background: var(--fg); color: #fff; border: 0; } .stat.dark .mono, .stat.dark .sub { color: rgba(255,255,255,.55); }
.stat.dark::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, #fff 1px, transparent 1px); background-size: 28px 28px; opacity: .05; }
.stat.featured { padding: 2px; background: var(--grad); }
.stat.featured > div { background: #fff; border-radius: 14px; padding: 22px; height: 100%; }
.pos { color: #059669 } .neg { color: #dc2626 }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-fg); padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 500; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; } tbody tr:hover td { background: rgba(0,82,255,.02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { white-space: nowrap; text-align: right; } .actions a { margin-left: 12px; font-size: 13px; }
.empty { text-align: center; color: var(--muted-fg); padding: 40px 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--muted); color: var(--muted-fg); }
.pill.active { background: rgba(0,82,255,.1); color: var(--accent); } .pill.done { background: #ecfdf5; color: #059669 } .pill.paused { background: #fffbeb; color: #b45309 }
.owner-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--muted); border-radius: 999px; padding: 2px 10px 2px 4px; font-size: 12px; margin: 2px 4px 2px 0; }
.owner-chip i { width: 20px; height: 20px; border-radius: 50%; background: var(--grad); color: #fff; font-style: normal; font-size: 10px; display: grid; place-items: center; font-weight: 600; }

/* chart */
.chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 180px; padding-top: 10px; }
.bar-col { display: flex; flex-direction: row; align-items: flex-end; justify-content: center; height: 100%; gap: 3px; position: relative; }
.bar { width: 45%; }
.bar { border-radius: 6px 6px 3px 3px; min-height: 2px; transition: height .7s cubic-bezier(.16,1,.3,1); }
.bar.inc { background: var(--grad); } .bar.exp { background: #cbd5e1; }
.bar-col:hover .tip { opacity: 1; transform: translate(-50%, -6px); }
.tip { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 0); opacity: 0; transition: all .2s; background: var(--fg); color: #fff; font-size: 11px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 2; }
.chart-x { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; font-family: var(--mono); font-size: 9px; color: var(--muted-fg); text-align: center; margin-top: 6px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted-fg); margin-top: 12px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-card { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--sh-xl); animation: up .35s cubic-bezier(.16,1,.3,1); }
@keyframes up { from { opacity: 0; transform: translateY(24px) } to { opacity: 1; transform: none } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 26px 0; }
.modal-head h3 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 400; }
.x { border: 0; background: var(--muted); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--muted-fg); }
#modal-form { padding: 20px 26px 26px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.owners-editor { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.owners-editor .orow { display: grid; grid-template-columns: 1fr 100px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.owners-editor .orow input, .owners-editor .orow select { margin: 0; height: 38px; }
.owners-editor .orow button { height: 34px; border: 0; background: var(--muted); border-radius: 8px; cursor: pointer; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--fg); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: all .3s; z-index: 60; pointer-events: none; box-shadow: var(--sh-xl); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.note-card { cursor: pointer; } .note-card p { color: var(--muted-fg); font-size: 14px; white-space: pre-wrap; margin: 0; max-height: 120px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.note-meta { font-size: 12px; color: var(--muted-fg); margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.skill-cat { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .3s; z-index: 40; }
  .side.open { transform: none; box-shadow: var(--sh-xl); }
  .menu-btn { display: grid; place-items: center; position: fixed; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: #fff; z-index: 45; box-shadow: var(--sh-md); cursor: pointer; }
  .main { padding: 24px 16px 60px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; } .row2 { grid-template-columns: 1fr; }
  h1.display { font-size: 2rem; } h2.display { font-size: 1.6rem; }
  .table-wrap { overflow-x: auto; }
}
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .ring, .float-card, .pulse { animation: none; } }
