:root {
  --bubble: #ffc4e1;
  --bubble-2: #ffe0ef;
  --hot: #ff2e93;
  --hot-deep: #d80f72;
  --ink: #120b0f;
  --ink-2: #3a2a32;
  --muted: #8a7180;
  --cream: #fff7fb;
  --white: #ffffff;
  --line: #f3dbe7;
  --good: #1f9d6b;
  --good-bg: #e3f6ee;
  --warn: #c77700;
  --warn-bg: #fff1d6;
  --bad: #d1243f;
  --bad-bg: #ffe3e8;
  --display: "Unbounded", "Arial Black", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, sans-serif;
  --radius: 22px;
  --shadow: 0 18px 40px -26px rgba(170, 20, 90, 0.45);
  --glitter:
    radial-gradient(circle at 13% 27%, rgba(255,255,255,.95) 0 0.9px, transparent 1.5px),
    radial-gradient(circle at 71% 12%, rgba(255,214,236,.9) 0 0.7px, transparent 1.3px),
    radial-gradient(circle at 42% 83%, rgba(255,255,255,.8) 0 1.1px, transparent 1.7px),
    radial-gradient(circle at 88% 64%, rgba(255,255,255,.7) 0 0.6px, transparent 1.1px),
    radial-gradient(circle at 27% 58%, rgba(255,190,225,.9) 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 59% 41%, rgba(255,255,255,.9) 0 0.5px, transparent 1px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--cream); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--hot-deep); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bubble);
  position: relative;
  overflow: hidden;
}
.login::before { content: ""; position: absolute; inset: 0; background-image: var(--glitter); background-size: 61px 61px, 83px 83px, 47px 47px; opacity: .6; }
.login-card {
  position: relative;
  width: min(100%, 420px);
  background: var(--white);
  border-radius: 32px;
  padding: 40px 34px;
  box-shadow: 0 40px 80px -40px rgba(170, 20, 90, .6);
  text-align: center;
}
.login-card h1 { font: 800 44px/1 var(--display); letter-spacing: -0.04em; margin: 0; }
.login-card h1 sup { color: var(--hot); font-size: 16px; vertical-align: top; }
.login-card .sub { font: italic 400 26px/1 var(--serif); color: var(--hot); margin: 6px 0 22px; }
.login-card p { color: var(--muted); margin: 0 0 20px; }
.login-card .note { font-size: 13px; margin-top: 16px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bubble);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.side::before { content: ""; position: absolute; inset: 0; background-image: var(--glitter); background-size: 61px 61px, 83px 83px, 47px 47px; opacity: .55; pointer-events: none; }
.side > * { position: relative; }
.brand { padding: 0 12px 22px; }
.brand b { font: 800 30px/1 var(--display); letter-spacing: -0.04em; }
.brand b sup { color: var(--hot); font-size: 12px; vertical-align: top; }
.brand span { display: block; font: italic 400 22px/1 var(--serif); color: var(--hot-deep); margin-top: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, .5); }
.nav a.on { background: var(--ink); color: var(--bubble); }
.nav a .count { margin-left: auto; background: var(--hot); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.side .who { margin-top: auto; padding: 12px 14px; font-size: 12px; color: var(--ink-2); word-break: break-all; }

.main { padding: 34px 40px 80px; max-width: 1240px; width: 100%; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.top h1 { font: 800 clamp(30px, 4vw, 44px)/1 var(--display); letter-spacing: -0.045em; margin: 0; }
.top h1 em { font: italic 400 1.15em/0.8 var(--serif); color: var(--hot); letter-spacing: -0.01em; }
.top .lede { color: var(--muted); margin: 8px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-banner { background: var(--ink); color: var(--bubble); text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 8px; }

/* ---------- Buttons and inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--hot); transform: translateY(-1px); }
.btn.hot { background: var(--hot); }
.btn.hot:hover { background: var(--ink); }
.btn.ghost { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--hot); background: var(--white); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.wide { width: 100%; padding: 15px; }
.btn:disabled { opacity: .6; cursor: wait; }

input, select, textarea {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  transition: border-color .15s ease, background .15s ease;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hot); background: #fff; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--hot); }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2); }
label.f.check { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; letter-spacing: 0; padding-top: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip.on { background: var(--ink); color: var(--bubble); border-color: var(--ink); }
.chip b { color: var(--hot); margin-left: 4px; }
.chip.on b { color: var(--bubble); }
.search { max-width: 260px; background: var(--white); border: 1.5px solid var(--line); }

/* ---------- Cards and grids ---------- */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g21 { grid-template-columns: 2fr 1fr; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card h2 { font: 700 15px/1.2 var(--display); letter-spacing: -0.02em; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h2 a { font: 600 12px/1 var(--body); text-decoration: none; }
.kpi .label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font: 800 30px/1.1 var(--display); letter-spacing: -0.04em; margin: 8px 0 4px; }
.kpi .hint { font-size: 13px; color: var(--muted); }
.kpi.pink { background: var(--hot); color: #fff; }
.kpi.pink .label, .kpi.pink .hint { color: rgba(255,255,255,.85); }
.kpi.black { background: var(--ink); color: var(--cream); }
.kpi.black .label, .kpi.black .hint { color: rgba(255, 220, 238, .75); }
.kpi.bubble { background: var(--bubble); position: relative; overflow: hidden; }
.kpi.bubble::before { content: ""; position: absolute; inset: 0; background-image: var(--glitter); background-size: 41px 41px, 57px 57px, 33px 33px; opacity: .7; }
.kpi.bubble > * { position: relative; }
.in { color: var(--good); }
.out { color: var(--ink); }
.kpi.pink .in, .kpi.black .in { color: inherit; }

.empty { color: var(--muted); text-align: center; padding: 22px 10px; font-size: 14px; }
.empty b { display: block; font: italic 400 24px/1.1 var(--serif); color: var(--hot); margin-bottom: 4px; }

/* ---------- Rows and lists ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-radius: 10px;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--cream); }
.row .when { font-size: 12px; color: var(--muted); font-weight: 600; }
.row .what { min-width: 0; }
.row .what b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .what span { font-size: 12px; color: var(--muted); }
.row .amt { font: 700 15px/1 var(--display); letter-spacing: -0.02em; white-space: nowrap; }
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--bubble-2);
  color: var(--hot-deep);
  margin-right: 4px;
  white-space: nowrap;
}
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.ink { background: var(--ink); color: var(--bubble); }

.bar { display: grid; grid-template-columns: 140px 1fr 80px; gap: 10px; align-items: center; font-size: 13px; padding: 6px 0; }
.bar .track { height: 10px; background: var(--bubble-2); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--hot); border-radius: 999px; }
.bar .n { text-align: right; font-weight: 700; }

.month-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.month-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.month-chart .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.month-chart .pair i { display: block; width: 40%; max-width: 18px; border-radius: 6px 6px 2px 2px; min-height: 2px; }
.month-chart .pair i.vin { background: var(--good); }
.month-chart .pair i.vout { background: var(--hot); }
.month-chart small { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Tasks */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task input { margin-top: 2px; flex: none; }
.task .t { flex: 1; min-width: 0; cursor: pointer; }
.task .t b { font-weight: 600; display: block; overflow-wrap: anywhere; }
.task .t span { font-size: 12px; color: var(--muted); }
.task.done .t b { text-decoration: line-through; color: var(--muted); }
.group-title { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--hot-deep); margin: 18px 0 4px; }
.group-title:first-child { margin-top: 0; }
.add-line { display: grid; grid-template-columns: 1fr 160px 150px auto; gap: 8px; margin-bottom: 18px; }

/* People board */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.lane { background: var(--bubble-2); border-radius: 20px; padding: 12px; min-height: 160px; }
.lane h3 { font: 700 13px/1 var(--display); margin: 4px 4px 12px; display: flex; justify-content: space-between; }
.person { background: var(--white); border-radius: 16px; padding: 12px; margin-bottom: 10px; cursor: pointer; box-shadow: 0 8px 20px -16px rgba(170,20,90,.5); }
.person b { display: block; }
.person small { color: var(--muted); display: block; margin-top: 2px; }
.person select { margin-top: 8px; padding: 6px 8px; font-size: 12px; }

/* Panel */
.app-card { padding: 14px 6px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 150px; gap: 14px; align-items: start; }
.app-card:last-child { border-bottom: 0; }
.app-card .who { cursor: pointer; min-width: 0; }
.app-card .who b { font-weight: 700; }
.app-card .who p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.app-card .meta { font-size: 12px; color: var(--muted); }
.app-card select { padding: 7px 10px; font-size: 13px; }
.funnel { display: flex; gap: 8px; flex-wrap: wrap; }

/* Guard */
.guard-head { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--bubble); border-radius: 999px; padding: 6px 12px; }
.alert { border-radius: 18px; padding: 16px 18px; margin-bottom: 12px; background: var(--bad-bg); }
.alert .k { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--bad); }
.alert .h { font: 700 17px/1.3 var(--display); letter-spacing: -0.02em; margin: 6px 0 4px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.alert li { margin: 3px 0; }
.alert .do { margin-top: 12px; background: var(--ink); color: var(--cream); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.alert.ok { background: var(--good-bg); }
.alert.ok .k { color: var(--good); }
.check-form .grid { gap: 10px; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(18, 11, 15, .45); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: var(--white); border-radius: 28px; width: min(100%, 680px); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; box-shadow: 0 40px 90px -30px rgba(0,0,0,.5); }
.modal h2 { font: 800 24px/1.1 var(--display); letter-spacing: -0.04em; margin: 0 0 18px; }
.modal .form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.modal .form .full { grid-column: 1 / -1; }
.modal .foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
.modal dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.modal dd { margin: 0; white-space: pre-wrap; }

/* Toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bubble); padding: 12px 18px; border-radius: 999px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------- Phone ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g21 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    z-index: 40;
    flex-direction: row;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    box-shadow: 0 -10px 30px -20px rgba(170, 20, 90, .6);
  }
  .brand, .side .who { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10px; padding: 7px 10px; }
  .nav a .count { position: absolute; margin: -4px 0 0 18px; }
  .main { padding: 22px 16px 110px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .modal .form { grid-template-columns: 1fr; }
  .add-line { grid-template-columns: 1fr 1fr; }
  .add-line input:first-child { grid-column: 1 / -1; }
  .board { grid-template-columns: repeat(5, 240px); }
  .app-card { grid-template-columns: 1fr; }
  .row { grid-template-columns: 70px 1fr auto; gap: 10px; }
  .bar { grid-template-columns: 110px 1fr 70px; }
  .modal dl { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .value { font-size: 22px; }
  .card { padding: 16px; }
  .search { max-width: none; }
}
