:root {
  --bg: #f8faf8;
  --card: #ffffff;
  --card2: #f3f7f5;
  --border: #e2e8e4;
  --hi: #cbd8d3;
  --gold: #ad7a2f;
  --gold2: #cf9a46;
  --purple: #6f63a8;
  --green: #087f6d;
  --amber: #b66a10;
  --red: #c84f49;
  --teal: #006b65;
  --teal-soft: #e8f4f2;
  --paper: #fffaf0;
  --paper-line: #eadcc5;
  --text: #1f2729;
  --muted: #65737a;
  --dim: #96a09d;
  --r: 8px;
  --shadow: 0 16px 40px rgba(31, 39, 41, .07);
  --shadow-soft: 0 8px 22px rgba(31, 39, 41, .05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 44%, #f5f8f6 100%);
  color: var(--text);
  font-family: Inter, sans-serif;
  min-height: 100vh;
}

.header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 60px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.brand {
  font-family: 'Playfair Display', serif;
  color: var(--teal);
  font-size: 22px;
}

.sub {
  font: 600 12px/1.45 Inter, sans-serif;
  color: var(--dim);
}

.center {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn:hover {
  background: var(--teal-soft);
  border-color: rgba(0, 107, 101, .32);
  color: var(--teal);
  box-shadow: 0 8px 18px rgba(0, 107, 101, .06);
}

.btn.gold {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 107, 101, .14);
}

.btn.gold:hover {
  background: #005a55;
  border-color: #005a55;
  color: #ffffff;
}

.btn.green {
  background: #eef8f5;
  border-color: rgba(8, 127, 109, .24);
  color: var(--green);
}

.btn.red {
  background: #fff6f5;
  border-color: #efd1cf;
  color: var(--red);
}

.btn.purple-btn {
  background: #f7f5ff;
  border-color: rgba(111, 99, 168, .24);
  color: var(--purple);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 22px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login {
  max-width: 420px;
  margin: 90px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login h1 {
  font-family: 'Playfair Display', serif;
  color: var(--teal);
  margin-bottom: 8px;
}

.login-copy {
  color: var(--muted);
  font-size: 14px;
}

.input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font: 14px/1.45 Inter, sans-serif;
  padding: 12px;
  margin-top: 12px;
}

.input:focus {
  outline: none;
  border-color: rgba(0, 107, 101, .42);
  box-shadow: 0 0 0 3px rgba(0, 107, 101, .1);
}

.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 40px);
  margin-top: 12px;
  margin-right: auto;
  margin-left: auto;
  padding: 12px 14px;
  border: 1px solid rgba(177, 76, 67, .16);
  border-radius: 8px;
  background: #fde7e4;
  color: #7d261f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.login-error-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 800;
}

.full-btn {
  width: 100%;
  margin-top: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
  gap: 34px;
  align-items: end;
  padding: 28px 0 10px;
}

.hero-copy {
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 107, 101, .2);
  background: var(--teal-soft);
  color: var(--teal);
  flex: 0 0 auto;
  font: 700 25px 'Playfair Display', serif;
}

.hero-kicker {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2px;
  margin-bottom: 8px;
}

.hero-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin-top: 8px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  align-items: end;
  gap: 0;
  min-width: 360px;
}

.metric-card {
  border-left: 1px solid var(--border);
  padding: 2px 18px 4px;
}

.metric-card span {
  display: block;
  color: var(--dim);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  margin-bottom: 8px;
}

.metric-card b {
  display: block;
  color: var(--text);
  font-size: 21px;
  line-height: 1.2;
}

.metric-card:first-child b {
  color: var(--teal);
  font-size: 32px;
}

.name {
  font: 900 38px/1.08 'Playfair Display', serif;
  letter-spacing: 0;
}

.tag {
  font-size: 12px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
}

.note {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 250, 240, .95)),
    var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: var(--r);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 18px 42px rgba(173, 122, 47, .09);
  position: relative;
}

.note::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), rgba(173, 122, 47, .55));
  border-radius: 0 0 999px 999px;
}

.note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.note-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}

.note-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(173, 122, 47, .14);
  padding: 4px 0 18px;
}

.note-kicker {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.2;
}

.note-heading {
  color: var(--text);
  font: 800 21px/1.25 'Playfair Display', serif;
  margin-top: 8px;
}

.note-pill {
  border: 1px solid rgba(173, 122, 47, .22);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(173, 122, 47, .08);
  font: 700 12px/1.25 Inter, sans-serif;
  padding: 6px 10px;
  white-space: nowrap;
}

.note-compose {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-label {
  color: var(--muted);
  font: 650 13px/1.35 Inter, sans-serif;
}

.note-field-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.note-field-head .note-title {
  margin-bottom: 0;
}

.saved-chip {
  border: 1px solid rgba(173, 122, 47, .22);
  border-radius: 999px;
  background: rgba(173, 122, 47, .08);
  color: var(--gold);
  font: 700 12px/1 Inter, sans-serif;
  padding: 5px 8px;
  white-space: nowrap;
}

.saved-chip.purple {
  border-color: rgba(111, 99, 168, .22);
  background: rgba(111, 99, 168, .08);
  color: var(--purple);
}

.note-divider {
  border-top: 1px solid rgba(101, 115, 122, .18);
  padding-top: 20px;
  margin-top: 2px;
}

.note-title {
  font: 700 13px/1.25 Inter, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold);
  margin-bottom: 8px;
}

.note-title.purple {
  color: var(--purple);
}

.note-title.amber {
  color: var(--amber);
}

.note-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

.note-muted {
  color: var(--muted);
}

.adjust-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.adjust-points {
  margin: 0;
  width: 90px;
}

.adjust-reason,
.note-input {
  margin: 0;
  flex: 1;
}

.note-textarea {
  min-height: 88px;
  resize: vertical;
}

.note-textarea.compact {
  min-height: 68px;
}

.note .input::placeholder {
  color: rgba(101, 115, 122, .68);
}

.note-save {
  align-items: center;
  display: flex;
  justify-content: center;
  justify-self: end;
  min-height: 38px;
  min-width: 88px;
}

.no-wrap {
  white-space: nowrap;
}

.adjust-list {
  margin-top: 10px;
  max-height: 120px;
  overflow: auto;
}

.adjust-list.tall {
  max-height: 150px;
}

.adjust-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.adjust-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.adjust-score {
  font-family: Inter, sans-serif;
  font-weight: 600;
}

.adjust-score.plus {
  color: var(--green);
}

.adjust-score.minus {
  color: var(--red);
}

.mini-btn {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 5px;
  padding: 2px 6px;
  font: 650 12px/1.2 Inter, sans-serif;
  cursor: pointer;
}

.weekbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.label {
  font: 700 13px/1.35 Inter, sans-serif;
  color: var(--dim);
}

.review-label {
  color: var(--amber);
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.week-grid,
.task-grid {
  margin-top: 12px;
}

.day {
  background: rgba(255, 255, 255, .7);
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 11px 8px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.day:hover {
  border-color: rgba(0, 107, 101, .25);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 39, 41, .05);
}

.day.sel {
  border-color: rgba(0, 107, 101, .4);
  background: #ffffff;
  box-shadow: inset 0 -3px 0 var(--teal);
}

.day.today .num {
  color: var(--teal);
}

.dname {
  font: 700 10px/1.2 Inter, sans-serif;
  color: var(--dim);
  letter-spacing: .3px;
}

.num {
  font-size: 19px;
  font-weight: 700;
  margin: 5px 0;
}

.pips {
  display: flex;
  gap: 3px;
  justify-content: center;
}

.pip {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: #e4ebe8;
}

.pip.ok {
  background: var(--green);
  box-shadow: none;
}

.pip.pending {
  background: rgba(182, 106, 16, .55);
}

.pip.na {
  background: transparent;
  border: 1px solid #dce4e1;
}

.tasks-head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.tasks-head h2 {
  font: 800 27px/1.1 'Playfair Display', serif;
}

.chip {
  font: 700 12px/1.25 Inter, sans-serif;
  color: var(--purple);
  background: transparent;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
}

.tasks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.task {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  position: relative;
  min-height: 292px;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.task:hover {
  border-color: rgba(0, 107, 101, .2);
  box-shadow: 0 14px 30px rgba(31, 39, 41, .06);
}

.task.pending {
  border-color: rgba(182, 106, 16, .34);
}

.task.approved {
  border-color: rgba(8, 127, 109, .34);
}

.task.rejected {
  border-color: rgba(200, 79, 73, .34);
}

.task.unlocked {
  border-color: rgba(111, 99, 168, .34);
}

.task.custom-task-card {
  border-color: rgba(111, 99, 168, .28);
}

.task.custom-task-card .pts {
  background: rgba(111, 99, 168, .1);
  border-color: rgba(111, 99, 168, .2);
  color: var(--purple);
}

.custom-task-form {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(232, 244, 242, .74)),
    var(--card);
  border-style: dashed;
}

.custom-task-form .emoji {
  color: var(--teal);
  font-weight: 800;
}

.custom-fields {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.custom-fields .input {
  margin-top: 0;
}

.repeat-mode,
.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.repeat-option,
.weekday-option {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font: 700 12px/1.25 Inter, sans-serif;
  gap: 6px;
  min-height: 34px;
  padding: 7px 9px;
}

.repeat-option input,
.weekday-option input {
  accent-color: var(--teal);
}

.task.lock {
  opacity: .58;
}

.emoji {
  font-size: 26px;
}

.task-main {
  display: flex;
  flex-direction: column;
  min-height: 112px;
}

.task-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.pts {
  display: inline-block;
  font: 700 12px/1.2 Inter, sans-serif;
  color: var(--gold);
  background: rgba(173, 122, 47, .1);
  border: 1px solid rgba(173, 122, 47, .2);
  padding: 2px 9px;
  border-radius: 20px;
  margin: 0;
}

.task h3 {
  font-size: 17px;
  margin-bottom: 5px;
}

.task p {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.55;
}

.freq {
  font: 650 12px/1.4 Inter, sans-serif;
  color: var(--dim);
  margin: 10px 0 12px;
}

.status {
  align-items: center;
  display: inline-flex;
  font: 700 13px/1.35 Inter, sans-serif;
  padding: 7px 11px;
  border-radius: 999px;
  margin: 0;
  color: var(--muted);
  background: var(--card2);
  border: 1px solid var(--border);
  width: fit-content;
}

.status-pending {
  color: var(--amber);
  background: #fff6e8;
  border-color: rgba(182, 106, 16, .18);
}

.status-approved {
  color: var(--green);
  background: #ecf8f5;
  border-color: rgba(8, 127, 109, .18);
}

.status-rejected {
  color: var(--red);
  background: #fff4f3;
  border-color: rgba(200, 79, 73, .18);
}

.status-unlocked {
  color: var(--purple);
  background: #f7f5ff;
  border-color: rgba(111, 99, 168, .2);
}

.status-idle {
  color: var(--muted);
  background: #f6f8f7;
}

.status.green-text {
  color: var(--green);
}

.thumb {
  width: 100%;
  max-height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 8px 0;
  cursor: pointer;
}

.proof-grid {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
}

.task-proof-area {
  margin: 4px 0 14px;
}

.task-proofs {
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
}

.task-proofs .thumb {
  aspect-ratio: 4 / 3;
  max-height: none;
  margin: 0;
}

.task-footer {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}

.task-actions {
  display: flex;
  min-height: 38px;
}

.task-actions .btn {
  width: 100%;
}

.custom-action-stack {
  display: grid;
  gap: 8px;
  width: 100%;
}

.custom-delete-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.custom-delete-row.single {
  grid-template-columns: 1fr;
}

.delete-task-btn {
  min-height: 30px;
  padding: 6px 8px;
}

.delete-task-btn.danger {
  border-color: rgba(200, 79, 73, .24);
  color: var(--red);
}

.task-action-note {
  align-items: center;
  color: var(--muted);
  display: flex;
  font: 650 13px/1.45 Inter, sans-serif;
  min-height: 38px;
}

.task-action-note.action-success {
  color: var(--green);
  font-weight: 700;
}

.review-proofs {
  grid-template-columns: repeat(2, 54px);
  flex-shrink: 0;
  margin: 0;
}

.review-proofs .review-thumb {
  width: 54px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: none;
}

.panel-head {
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.panel-body {
  padding: 16px 18px;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 0;
  margin-bottom: 0;
}

.stat:last-child {
  border-bottom: 0;
}

.bar {
  width: 90px;
  height: 5px;
  background: #e7eeeb;
  border-radius: 3px;
  overflow: hidden;
}

.fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.stat-progress {
  display: flex;
  gap: 8px;
  align-items: center;
}

.log {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-rows {
  display: flex;
  flex-direction: column;
}

.log-row {
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
  font-size: 12px;
  color: var(--muted);
}

.log-title {
  flex: 1;
}

.log-points {
  color: var(--gold);
}

.log-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 2px;
}

.log-page {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card2);
  color: var(--muted);
  cursor: pointer;
  font: 700 12px Inter, sans-serif;
}

.log-page:hover {
  border-color: rgba(0, 107, 101, .3);
  color: var(--teal);
}

.log-page.active {
  background: var(--teal-soft);
  border-color: rgba(0, 107, 101, .36);
  color: var(--teal);
}

.empty-state {
  color: var(--dim);
  text-align: center;
  padding: 25px 20px;
}

.review-item {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.review-main {
  flex: 1;
}

.review-actions {
  display: flex;
  gap: 8px;
}

.task-actions .review-actions {
  width: 100%;
}

.task-actions .review-actions .btn {
  flex: 1;
}

.muted-btn {
  border-color: var(--border);
  color: var(--muted);
  font-size: 12px;
}

.wide-btn {
  width: 100%;
  margin-top: 4px;
}

.hidden {
  display: none !important;
}

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 248, .9);
  backdrop-filter: blur(10px);
  z-index: 99;
  display: none;
  align-items: center;
  justify-content: center;
}

#lightbox.open {
  display: flex;
}

#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .86);
  box-shadow: 0 24px 60px rgba(31, 39, 41, .2);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  box-shadow: 0 14px 34px rgba(31, 39, 41, .14);
  z-index: 120;
}

@media (max-width: 850px) {
  .hero,
  .grid2 {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 22px;
    padding-top: 16px;
  }

  .hero-copy {
    align-items: flex-start;
  }

  .name {
    font-size: 31px;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, 1fr);
    min-width: 0;
  }

  .metric-card {
    padding: 0 10px;
  }

  .metric-card:first-child {
    border-left: 0;
    padding-left: 0;
  }

  .metric-card b {
    font-size: 16px;
  }

  .metric-card:first-child b {
    font-size: 24px;
  }

  .tasks {
    grid-template-columns: 1fr;
  }

  .week {
    grid-template-columns: repeat(4, 1fr);
  }

  .header {
    padding: 0 14px;
  }

  .center {
    display: none;
  }

  .note {
    padding: 22px 16px 18px;
  }

  .note::before {
    left: 16px;
    right: 16px;
  }

  .note-header {
    flex-direction: column;
  }

  .note-row {
    grid-template-columns: 1fr;
  }

  .note-save {
    min-height: 42px;
    width: 100%;
  }

  .tasks-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
