:root {
  --ink: #161616;
  --white: #ffffff;
  --paper: #fffafd;
  --soft-blue: #dff3ff;
  --soft-pink: #fff0fb;
  --pink: #e531b5;
  --pink-2: #ff4fc7;
  --purple: #583aca;
  --lavender: #b3a0f1;
  --yellow: #ffcc33;
  --green: #2fd583;
  --red: #ff5a72;
  --muted: #5d5d66;
  --line: #d9cef9;
  --shadow: 0 22px 55px rgba(88, 58, 202, .13);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(229,49,181,.16), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(179,160,241,.24), transparent 26%),
    linear-gradient(180deg, #fff 0%, #fff6fd 45%, #e8f6ff 100%);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }
.hidden { display: none !important; }
.app-frame { width: min(1440px, 100%); margin: 0 auto; min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.side-rail { min-height: 100vh; padding: 22px 16px; border-right: 1px solid rgba(179,160,241,.55); background: rgba(255,255,255,.74); backdrop-filter: blur(12px); display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; }
.logo-wrap { display: inline-flex; align-items: center; justify-content: center; width: 104px; height: 66px; border-radius: 20px; background: #fff; box-shadow: 0 12px 34px rgba(0,0,0,.08); border: 1px solid rgba(179,160,241,.38); padding: 8px; }
.logo-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rail-nav { display: grid; gap: 8px; margin-top: 10px; }
.nav-item { width: 100%; min-height: 44px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 950; text-align: left; padding: 0 16px; cursor: pointer; }
.nav-item.active { color: #fff; background: linear-gradient(135deg, var(--pink), var(--purple)); box-shadow: 0 14px 32px rgba(229,49,181,.22); }
.nav-item.ghost { border-color: rgba(179,160,241,.5); background: rgba(255,255,255,.65); color: var(--purple); opacity: .7; }
.rail-user { margin-top: auto; border-radius: 24px; background: #fff; border: 1px solid rgba(179,160,241,.55); padding: 14px; box-shadow: 0 10px 28px rgba(88,58,202,.1); }
.rail-user strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user span { color: var(--pink); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 950; }
.main-area { padding: 20px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.eyebrow, .section-kicker { color: var(--pink); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 950; }
h1 { margin: 4px 0 0; font-size: clamp(36px, 5vw, 70px); line-height: .92; letter-spacing: -.065em; }
h2 { margin: 4px 0 10px; font-size: 25px; letter-spacing: -.035em; line-height: 1.05; }
.muted { color: var(--muted); margin: 0; line-height: 1.45; }
.top-stats { display: flex; gap: 10px; }
.top-stats div { width: 104px; min-height: 76px; border-radius: 24px; background: var(--purple); color: #fff; display: grid; place-items: center; align-content: center; box-shadow: 0 16px 36px rgba(88,58,202,.25); }
.top-stats div:last-child { background: var(--pink); }
.top-stats strong { font-size: 30px; line-height: 1; }
.top-stats span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .9; font-weight: 850; }
.panel { border: 1px solid rgba(179,160,241,.62); background: rgba(255,255,255,.9); box-shadow: var(--shadow); border-radius: var(--radius-xl); padding: 20px; }
.login-panel { max-width: 620px; }
.telegram-widget-wrap { min-height: 44px; margin: 16px 0 10px; }
.link-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; margin-right: 10px; }
.btn { border: 0; border-radius: 999px; min-height: 50px; padding: 14px 18px; color: #fff; font-weight: 950; cursor: pointer; }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--purple)); box-shadow: 0 15px 32px rgba(229,49,181,.25); }
.workspace { display: grid; gap: 16px; }
.quick-create { padding: 16px; }
.inline-create {
  margin: 6px 0 12px 40px;
  width: calc(100% - 40px);
  max-width: calc(100% - 40px);
  position: relative;
  padding: 10px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid rgba(88,58,202,.12);
}
.inline-create .quick-head { display: none; }
.inline-create label { margin: 0; }
.inline-create label:first-of-type { position: relative; display: block; font-size: 0; }
.inline-create label:first-of-type::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 11px;
  width: 2px;
  height: 26px;
  background: var(--pink);
}
.inline-create label:first-of-type > span { display: none; }
.inline-create textarea#title {
  min-height: 44px;
  height: 44px;
  padding: 8px 82px 8px 10px;
  border: 0;
  border-bottom: 1px solid rgba(88,58,202,.14);
  border-radius: 0;
  box-shadow: none;
  resize: none;
  background: rgba(255,255,255,.28);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.inline-create textarea#title::placeholder { color: rgba(93,93,102,.5); font-weight: 500; }
.inline-create textarea#title:focus { box-shadow: none; border-color: rgba(229,49,181,.55); }
.inline-create .quick-grid {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 8px;
}
.inline-create .quick-grid label:first-child { display: none; }
.inline-create .quick-grid label { gap: 4px; font-size: 0; }
.inline-create .quick-grid select,
.inline-create .quick-grid input {
  min-height: 38px;
  border-radius: 4px;
  background: rgba(255,255,255,.72);
  font-size: 13px;
  font-weight: 850;
  padding: 8px 10px;
}
.inline-create > label:nth-of-type(2),
.inline-create #linkUrl { display: none; }
.inline-create #createBtn {
  position: absolute;
  right: 42px;
  top: 18px;
  min-height: 24px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--purple);
  box-shadow: none;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.inline-cancel {
  position: absolute;
  right: 0;
  top: 17px;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.inline-cancel:hover { color: var(--red); }
.quick-head, .tracker-head, .side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.quick-grid { display: grid; grid-template-columns: 160px 160px 1fr; gap: 10px; }
label { display: grid; gap: 7px; margin: 0 0 12px; color: #3a3340; font-size: 12px; font-weight: 900; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); background: #fff; padding: 12px 13px; outline: none; min-height: 46px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 5px rgba(229,49,181,.14); }
.optional-link { margin: -4px 0 12px; }
.small-btn, .week-nav button, .round-plus { border: 1px solid var(--line); background: #fff; color: var(--purple); border-radius: 999px; min-height: 40px; padding: 0 14px; cursor: pointer; font-weight: 950; box-shadow: 0 8px 18px rgba(88,58,202,.08); }
.tracker-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.week-panel { min-width: 0; overflow: hidden; }
.week-nav { display: flex; align-items: center; gap: 8px; padding: 5px; border: 1px solid rgba(179,160,241,.55); background: #fff; border-radius: 999px; }
.week-nav strong { min-width: 210px; text-align: center; color: var(--purple); font-weight: 950; }
.week-nav button { min-width: 42px; padding: 0; font-size: 24px; line-height: 1; }
.week-grid { display: grid; gap: 18px; margin-top: 20px; }
.day-lane { border: 0; border-radius: 0; background: transparent; padding: 0; display: grid; gap: 0; box-shadow: none; }
.day-lane.today .lane-head { border-bottom-color: rgba(229,49,181,.75); }
.lane-head { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 12px; min-height: 40px; padding: 0 0 8px; border-bottom: 1px solid rgba(88,58,202,.18); }
.lane-date { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.lane-head strong { color: var(--muted); font-size: 12px; letter-spacing: .16em; font-weight: 950; }
.lane-head span { color: var(--muted); font-size: 15px; font-weight: 850; }
.lane-head em { display: inline-grid; place-items: center; min-height: 25px; padding: 0 9px; border-radius: 4px; background: rgba(255,204,51,.24); color: var(--purple); border: 1px solid rgba(255,204,51,.55); font-style: normal; font-size: 10px; letter-spacing: .08em; font-weight: 950; }
.lane-head small { justify-self: end; color: var(--purple); font-size: 12px; font-weight: 950; }
.lane-tasks { display: grid; gap: 0; }
.empty-lane { min-height: 42px; display: flex; align-items: center; padding-left: 40px; color: rgba(93,93,102,.6); border-bottom: 1px solid rgba(88,58,202,.09); }
.task-row { min-height: 58px; display: grid; grid-template-columns: 26px 1fr 42px 72px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(88,58,202,.1); background: transparent; }
.task-check { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(88,58,202,.28); background: #fff; color: #fff; font-size: 12px; font-weight: 950; cursor: pointer; }
.task-row.done .task-check { background: var(--yellow); border-color: var(--yellow); color: var(--purple); }
.task-main { min-width: 0; display: grid; gap: 3px; }
.task-main strong { font-size: 14px; line-height: 1.28; color: var(--ink); overflow-wrap: anywhere; }
.task-row.done .task-main strong { color: rgba(93,93,102,.72); text-decoration: line-through; text-decoration-thickness: 1px; }
.task-main span { color: var(--muted); font-size: 12px; }
.task-menu { justify-self: end; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--purple); cursor: pointer; font-size: 18px; }
.task-delete { justify-self: end; min-width: 68px; height: 32px; border-radius: 999px; border: 1px solid rgba(255,90,114,.28); background: rgba(255,90,114,.05); color: rgba(255,90,114,.82); cursor: pointer; font-size: 12px; font-weight: 900; line-height: 1; padding: 0 10px; }
.task-delete:hover, .move-row button.danger:hover { background: rgba(255,90,114,.12); color: var(--red); }
.add-day { justify-self: start; min-height: 34px; border: 0; background: transparent; color: var(--pink); cursor: pointer; font-weight: 950; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 0; }
.right-stack { display: grid; gap: 16px; }
.side-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.round-plus { min-width: 42px; height: 42px; padding: 0; background: var(--pink); border-color: var(--pink); color: #fff; font-size: 20px; }
.backlog-list { display: grid; gap: 10px; margin-top: 12px; }
.team-list { display: grid; gap: 10px; margin-top: 12px; }
.team-item { border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: rgba(255,255,255,.78); display: grid; gap: 10px; }
.team-item.pending { border-color: rgba(229,49,181,.35); background: rgba(229,49,181,.05); }
.team-item strong { display: block; font-size: 14px; }
.team-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.team-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.team-actions button { border: 1px solid var(--line); background: #fff; color: var(--purple); border-radius: 999px; min-height: 30px; padding: 0 10px; font-size: 11px; font-weight: 900; cursor: pointer; }
.team-actions .primary-mini { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--pink), var(--purple)); }
.backlog-item { border: 1px solid rgba(179,160,241,.68); border-left: 5px solid var(--yellow); border-radius: 20px; padding: 12px; background: #fff; display: grid; gap: 8px; }
.backlog-item.urgent { border-left-color: var(--red); }
.backlog-item.low { border-left-color: #bfc1ca; }
.backlog-item strong { font-size: 14px; line-height: 1.25; }
.backlog-item span, .empty-backlog { color: var(--muted); font-size: 12px; }
.move-row { display: flex; gap: 7px; flex-wrap: wrap; }
.move-row button { border: 1px solid var(--line); background: #fff; color: var(--purple); border-radius: 999px; min-height: 34px; padding: 0 10px; font-weight: 900; cursor: pointer; }
.move-row button.danger { border-color: rgba(255,90,114,.28); color: rgba(255,90,114,.82); }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.analytics-grid div { border-radius: 22px; padding: 14px; background: linear-gradient(180deg, #fff 0%, #fff4fc 100%); border: 1px solid rgba(179,160,241,.55); }
.analytics-grid span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 950; }
.analytics-grid strong { display: block; color: var(--purple); font-size: 30px; line-height: 1; margin: 8px 0 4px; }
.analytics-grid small { color: var(--pink); font-weight: 850; }
@media (max-width: 1180px) {
  .app-frame { grid-template-columns: 1fr; }
  .side-rail { min-height: auto; position: static; flex-direction: row; align-items: center; padding: 12px; border-right: 0; border-bottom: 1px solid rgba(179,160,241,.55); }
  .rail-nav { display: flex; margin: 0; flex: 1; }
  .nav-item.ghost { display: none; }
  .rail-user { margin: 0 0 0 auto; min-width: 140px; }
  .tracker-layout { grid-template-columns: 1fr; }
  .right-stack { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .main-area { padding: 12px; }
  .topbar { align-items: flex-start; }
  .top-stats { display: none; }
  h1 { font-size: 42px; }
  .quick-head, .tracker-head { flex-direction: column; }
  .quick-grid { grid-template-columns: 1fr; gap: 0; }
  .week-nav { width: 100%; justify-content: space-between; }
  .week-nav strong { min-width: 0; flex: 1; font-size: 14px; }
  .week-grid { grid-template-columns: 1fr; }
  .day-lane { min-height: 0; }
  .right-stack { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .inline-create { margin-left: 0; width: 100%; max-width: 100%; }
  .inline-create .quick-grid { grid-template-columns: 1fr; }
  .inline-create #createBtn { right: 36px; }
  .inline-cancel { top: 17px; }
  .task-row { grid-template-columns: 24px 1fr 34px 62px; gap: 7px; }
  .task-menu { width: 32px; height: 32px; }
  .task-delete { min-width: 58px; height: 30px; font-size: 11px; padding: 0 7px; }
}
@media (max-width: 460px) {
  .side-rail { gap: 10px; }
  .logo-wrap { width: 76px; height: 50px; border-radius: 16px; }
  .rail-user { min-width: 118px; padding: 10px; }
  .rail-user strong { font-size: 13px; }
  .panel { padding: 15px; border-radius: 24px; }
  .analytics-grid { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; }
  .btn, .add-day { min-height: 48px; }
}
