/* TASKLY — dark purple neon theme */
:root {
  --bg: #07040d;
  --bg2: #0e0819;
  --card: #140c22;
  --card2: #1b1030;
  --line: rgba(168, 85, 247, 0.16);
  --line2: rgba(168, 85, 247, 0.32);
  --text: #ffffff;
  --muted: #b7b1c7;
  --dim: #7d7393;
  --accent: #a855f7;
  --accent2: #7c3aed;
  --neon: 0 0 0 1px rgba(168, 85, 247, 0.35), 0 8px 30px rgba(124, 58, 237, 0.28);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 18px;
  --nav-h: 70px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-synthesis: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(124, 58, 237, 0.28), transparent 60%),
    radial-gradient(800px 400px at -10% 20%, rgba(168, 85, 247, 0.12), transparent 60%),
    var(--bg);
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
img.ic { display: inline-block; vertical-align: middle; flex: none; }

/* ---------- layout */
#app { max-width: 640px; margin: 0 auto; padding: 14px 14px calc(var(--nav-h) + var(--safe-b) + 18px); }
.view { animation: fadeUp 0.28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.9; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 0%, 100% { box-shadow: var(--neon); } 50% { box-shadow: 0 0 0 1px rgba(168,85,247,.55), 0 10px 40px rgba(168,85,247,.45); } }

.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mt { margin-top: 14px; } .mt2 { margin-top: 22px; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 12.5px; } .tiny { font-size: 11px; }
.bold { font-weight: 700; } .center { text-align: center; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 20px; } h3 { font-size: 16px; }
.section-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin: 22px 2px 10px; }

/* ---------- header */
.header { display: flex; align-items: center; gap: 12px; padding: 4px 2px 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--card2); border: 2px solid var(--line2); display: grid; place-items: center; font-weight: 700; color: var(--accent); overflow: hidden; flex: none; }
.avatar.lg { width: 84px; height: 84px; font-size: 28px; }
.name-line { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; min-width: 0; }
.name-line .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-img { width: 18px; height: 18px; flex: none; }
.badge-img.lg { width: 24px; height: 24px; }

/* ---------- cards */
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.neon { box-shadow: var(--neon); border-color: var(--line2); }
.card.hero {
  background: radial-gradient(circle at 100% 0%, rgba(168, 85, 247, 0.45), transparent 55%), linear-gradient(135deg, #2a1150, #150a28 60%, #0f0820);
  border-color: var(--line2); box-shadow: var(--neon); animation: glow 5s ease-in-out infinite;
}
.big-amount { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.stat { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat .v { font-weight: 800; font-size: 18px; margin-top: 4px; }
.stat .l { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.tile { display: flex; align-items: center; gap: 10px; }
.tile-ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(168, 85, 247, 0.12); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }

/* ---------- buttons */
.btn { appearance: none; border: 0; cursor: pointer; border-radius: 14px; padding: 12px 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.12s ease, opacity 0.2s, box-shadow 0.2s; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 6px 22px rgba(124, 58, 237, 0.45); }
.btn.ghost { background: rgba(168, 85, 247, 0.1); color: #e9d5ff; border: 1px solid var(--line2); }
.btn.danger { background: rgba(248, 113, 113, 0.12); color: var(--bad); border: 1px solid rgba(248, 113, 113, 0.35); }
.btn.success { background: rgba(52, 211, 153, 0.12); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.35); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn img.ic { filter: brightness(0) invert(1); }
.btn.ghost img.ic { filter: none; }
.icon-btn { background: rgba(168, 85, 247, 0.1); border: 1px solid var(--line); border-radius: 12px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }

/* ---------- chips & pills */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.chip.active { background: rgba(168, 85, 247, 0.2); color: #fff; border-color: var(--accent); box-shadow: 0 0 18px rgba(168, 85, 247, 0.35); }
.chip img.ic { opacity: 0.7; } .chip.active img.ic { opacity: 1; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(168, 85, 247, 0.16); color: #e9d5ff; white-space: nowrap; }
.pill.ok { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.pill.warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.pill.bad { background: rgba(248, 113, 113, 0.14); color: var(--bad); }
.pill.dim { background: rgba(255, 255, 255, 0.06); color: var(--muted); }

/* ---------- task card */
.task { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); cursor: pointer; transition: border-color 0.2s, transform 0.15s; }
.task:active { transform: scale(0.985); }
.task:hover { border-color: var(--line2); }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.reward { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: #e9d5ff; }
.progress { height: 6px; background: rgba(255, 255, 255, 0.06); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; transition: width 0.6s ease; }

/* ---------- lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); border-radius: 14px; }
.li .grow { flex: 1; min-width: 0; }
.amount-pos { color: var(--ok); font-weight: 800; } .amount-neg { color: var(--bad); font-weight: 800; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }

/* ---------- chart */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; margin-top: 12px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar i { width: 100%; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent), var(--accent2)); min-height: 4px; box-shadow: 0 0 14px rgba(168, 85, 247, 0.35); transition: height 0.7s cubic-bezier(.2,.8,.2,1); }
.bars .bar span { font-size: 10.5px; color: var(--dim); }

/* ---------- banner */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius); border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.07); }
.banner.info { border-color: var(--line2); background: rgba(168, 85, 247, 0.08); }
.banner.bad { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.07); }

/* ---------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input { width: 100%; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line2); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2); }
textarea.input { min-height: 90px; resize: vertical; }
select.input option { background: var(--bg2); }
.seg { display: grid; grid-auto-flow: column; gap: 6px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 8px; border-radius: 10px; color: var(--muted); font-weight: 700; cursor: pointer; font-size: 13px; }
.seg button.active { background: rgba(168, 85, 247, 0.22); color: #fff; }

/* ---------- bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px 10px calc(8px + var(--safe-b)); background: rgba(10, 6, 18, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.nav-inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--dim); font-size: 11px; font-weight: 600; transition: color 0.2s; }
.nav a img.ic { opacity: 0.45; filter: grayscale(0.6); transition: all 0.2s; }
.nav a.active { color: #fff; }
.nav a.active img.ic { opacity: 1; filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.8)); transform: translateY(-1px); }

/* ---------- sheet / modal */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 40; opacity: 0; transition: opacity 0.25s; backdrop-filter: blur(2px); }
.backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88vh; overflow-y: auto; background: linear-gradient(180deg, #1a0f2e, #0e0819); border-top: 1px solid var(--line2); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); transform: translateY(100%); transition: transform 0.3s cubic-bezier(.2,.8,.2,1); max-width: 640px; margin: 0 auto; box-shadow: 0 -10px 40px rgba(124, 58, 237, 0.25); }
.sheet.show { transform: none; }
.sheet .grab { width: 42px; height: 5px; border-radius: 9px; background: var(--line2); margin: 0 auto 12px; }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ---------- toast */
#toasts { position: fixed; top: 12px; left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; max-width: 560px; width: 100%; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #1d1233; border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: fadeUp 0.25s ease both; }
.toast.ok { border-color: rgba(52, 211, 153, 0.5); } .toast.bad { border-color: rgba(248, 113, 113, 0.5); }

/* ---------- loading */
.skeleton { border-radius: 14px; background: linear-gradient(90deg, rgba(168,85,247,.06), rgba(168,85,247,.14), rgba(168,85,247,.06)); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(168, 85, 247, 0.25); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.splash { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.logo { font-weight: 900; font-size: 30px; letter-spacing: 0.08em; background: linear-gradient(135deg, #fff, #c084fc 40%, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 30px rgba(168, 85, 247, 0.35); }
.empty { text-align: center; padding: 34px 12px; color: var(--muted); }
.empty img.ic { opacity: 0.6; margin-bottom: 8px; }

/* ---------- table (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { color: var(--muted); font-weight: 600; background: rgba(168, 85, 247, 0.06); position: sticky; top: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.clickable { cursor: pointer; } table.t tr.clickable:hover td { background: rgba(168, 85, 247, 0.05); }
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; position: sticky; top: 0; z-index: 10; background: linear-gradient(180deg, var(--bg) 70%, transparent); padding-top: 6px; }
.admin-tabs::-webkit-scrollbar { display: none; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: rgba(168, 85, 247, 0.1); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
pre.mono { white-space: pre-wrap; padding: 10px; }
