:root {
  --ink: #2e2926;
  --muted: #75675c;
  --cream: #f7f2e9;
  --paper: #fffdf9;
  --sand: #e9ddcc;
  --peach: #c9a77d;
  --terracotta: #8e4b39;
  --terracotta-dark: #69372c;
  --sage: #58695c;
  --sage-soft: #e4e9df;
  --gold: #b4873a;
  --blush: #ebddd1;
  --line: #ded0c0;
  --shadow: 0 16px 40px rgba(58, 45, 36, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 13px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--cream); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% 1%, rgba(170, 119, 79, 0.16), transparent 26rem),
    radial-gradient(circle at 2% 39%, rgba(143, 105, 69, 0.1), transparent 23rem),
    var(--cream);
  font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.55;
}

button { font: inherit; }
button:focus-visible, .task-card:focus-visible {
  outline: 3px solid rgba(142, 75, 57, 0.35);
  outline-offset: 3px;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar, .topbar-actions, .hero, .section-heading, .task-main, .task-status, .charity-counter, .progress-card, .section-nav, .brand-block, .day-note {
  display: flex;
  align-items: center;
}

.topbar { justify-content: space-between; margin-bottom: 28px; gap: 20px; }
.topbar-actions { gap: 9px; }
.brand-block { gap: 13px; }
.brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center;
  color: var(--terracotta); background: var(--blush); border: 1px solid #e1cabc; border-radius: 14px;
  transform: none;
}
.brand-mark svg { width: 31px; height: 31px; }
.eyebrow { margin: 0 0 -2px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
h1 { margin: 0; letter-spacing: -0.04em; font-size: 1.65rem; line-height: 1.15; }

.reset-button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 14px; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; background: rgba(255,255,255,0.62); transition: 180ms ease;
  font-size: 0.85rem; font-weight: 700;
}
.reset-button svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.reset-button:hover { color: var(--terracotta-dark); background: #fff; border-color: #dcb4a0; transform: translateY(-1px); }
.report-button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 14px;
  border: 1px solid var(--terracotta); border-radius: 999px; color: #fff; background: var(--terracotta);
  box-shadow: 0 6px 15px rgba(105, 55, 44, .16); font-size: .85rem; font-weight: 800; transition: 180ms ease;
}
.report-button svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.report-button:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); transform: translateY(-1px); }

.hero {
  position: relative; overflow: hidden; justify-content: space-between; gap: 40px;
  padding: clamp(28px, 5vw, 52px); min-height: 254px; border-radius: var(--radius-lg);
  background: linear-gradient(112deg, #ded2c0 0%, #efe6d8 50%, #fbf8f2 100%);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; left: -38px; bottom: -74px; width: 220px; height: 160px;
  background: rgba(142, 75, 57, 0.1); border-radius: 50% 50% 0 0; transform: rotate(24deg);
}
.hero-copy { position: relative; z-index: 1; max-width: 590px; }
.date-label { margin: 0 0 9px; color: var(--terracotta-dark); font-size: 0.88rem; font-weight: 800; }
h2 { margin: 0; max-width: 550px; font-size: clamp(1.7rem, 3.2vw, 2.65rem); line-height: 1.26; letter-spacing: -0.045em; }
.hero-copy > p:not(.date-label) { margin: 10px 0 16px; color: var(--muted); font-size: 1rem; }
.focus-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; color: #654d36; border: 1px solid rgba(180, 135, 58, .3); border-radius: 999px; background: rgba(255, 252, 247, .72); font-size: .8rem; font-weight: 700; }
.spark { color: var(--gold); font-size: 1rem; }

.progress-card { position: relative; z-index: 1; flex: 0 0 auto; gap: 14px; padding: 12px 16px 12px 12px; border: 1px solid rgba(255,255,255,.75); border-radius: 22px; background: rgba(255, 253, 249, .68); backdrop-filter: blur(6px); }
.progress-ring { position: relative; width: 104px; height: 104px; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 8; }
.ring-track { stroke: rgba(88, 105, 92, .16); }
.ring-value { stroke: var(--terracotta); stroke-linecap: round; stroke-dasharray: 301.593; stroke-dashoffset: 301.593; transition: stroke-dashoffset .5s cubic-bezier(.2,.8,.2,1); }
.ring-content { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.12; }
.ring-content strong { color: var(--terracotta-dark); font-size: 1.35rem; }
.ring-content span { color: var(--muted); font-size: .68rem; font-weight: 700; }
.progress-summary { align-items: flex-start; flex-direction: column; gap: 2px; min-width: 102px; }
.progress-summary span { color: var(--ink); font-size: .88rem; font-weight: 800; }
.progress-summary small { color: var(--muted); max-width: 125px; font-size: .74rem; }

.section-nav { gap: 9px; margin: 24px 0 22px; overflow-x: auto; padding: 2px 1px 8px; scrollbar-width: thin; }
.nav-pill { flex: 0 0 auto; padding: 7px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 253, 249, .75); text-decoration: none; font-size: .8rem; font-weight: 800; transition: .16s ease; }
.nav-pill:hover { color: var(--terracotta-dark); border-color: #cfab98; background: #fff; }
.nav-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; vertical-align: 1px; background: var(--dot); }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.39fr); align-items: start; gap: 24px; }
.dashboard { display: grid; gap: 20px; }
.category-section { scroll-margin-top: 14px; }
.section-heading { justify-content: space-between; margin: 0 4px 11px; }
.section-heading-main { display: flex; align-items: center; gap: 10px; }
.category-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent); border-radius: 11px; background: var(--tint); }
.category-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.category-icon .fill-icon { fill: currentColor; stroke: none; }
.section-heading h3 { margin: 0; font-size: 1rem; letter-spacing: -0.02em; }
.section-count { color: var(--muted); font-size: .77rem; font-weight: 800; }
.task-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 11px; }

.task-card {
  position: relative; display: flex; align-items: center; min-height: 78px; gap: 11px; cursor: pointer;
  padding: 13px 14px; border: 1px solid transparent; border-radius: var(--radius-md); background: var(--paper);
  box-shadow: 0 7px 24px rgba(58, 45, 36, .06); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.task-card:hover { transform: translateY(-2px); border-color: #e0d2c3; box-shadow: 0 12px 28px rgba(58, 45, 36, .1); }
.task-card.is-done { border-color: #d9e0d3; background: linear-gradient(105deg, #fbfcf9, #f1f4ed); }
.task-card.is-done .task-title { color: #62705f; text-decoration: line-through; text-decoration-color: #a1b19a; text-decoration-thickness: 1.5px; }
.task-card.is-done .task-dot { background: #98a990; }
.task-main { flex: 1; min-width: 0; gap: 10px; }
.task-check { flex: 0 0 auto; width: 25px; height: 25px; display: grid; place-items: center; border: 1.7px solid #cfb8a9; border-radius: 9px; color: white; background: #fff; transition: .18s ease; }
.task-check svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.65); transition: .18s ease; }
.is-done .task-check { border-color: var(--sage); background: var(--sage); }
.is-done .task-check svg { opacity: 1; transform: scale(1); }
.task-title { color: var(--ink); font-size: .91rem; font-weight: 800; line-height: 1.45; transition: .18s ease; }
.task-status { gap: 6px; flex: 0 0 auto; color: #a28a7c; font-size: .68rem; font-weight: 800; }
.task-dot { width: 6px; height: 6px; border-radius: 50%; background: #d7c5b8; transition: .18s ease; }
.done-label { color: var(--sage); }

.task-card.has-counter { align-items: stretch; flex-wrap: wrap; border-color: #e5d2c0; background: linear-gradient(135deg, #fffdf9 50%, #fbf4e9); }
.has-counter .task-main { min-height: 30px; }
.charity-counter { width: 100%; justify-content: space-between; margin-top: 2px; padding: 8px 9px; border-radius: 12px; background: rgba(244, 229, 207, .63); }
.counter-label { color: #886a4e; font-size: .74rem; font-weight: 800; }
.counter-controls { display: flex; direction: ltr; align-items: center; gap: 8px; }
.counter-button { width: 27px; height: 27px; display: grid; place-items: center; cursor: pointer; border: 1px solid #e2c9ad; border-radius: 8px; color: var(--terracotta-dark); background: #fffdf9; font-weight: 800; line-height: 1; transition: .16s ease; }
.counter-button:hover { color: #fff; border-color: var(--terracotta); background: var(--terracotta); }
.counter-value { min-width: 24px; color: var(--terracotta-dark); text-align: center; font-variant-numeric: tabular-nums; font-weight: 900; }

.monthly-goals { position: sticky; top: 18px; overflow: hidden; padding: 20px; border: 1px solid #dfcfbd; border-radius: 22px; background: linear-gradient(145deg, #fffdf9, #f7eee3); box-shadow: 0 12px 30px rgba(58, 45, 36, .075); }
.monthly-goals::before { content: ""; display: block; width: 47px; height: 4px; margin-bottom: 15px; border-radius: 999px; background: var(--gold); }
.monthly-goals-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.goals-kicker { margin: 0 0 3px; color: var(--terracotta); font-size: .71rem; font-weight: 900; letter-spacing: .035em; }
.monthly-goals h2 { margin: 0; font-size: 1.16rem; line-height: 1.25; }
.goals-count { flex: 0 0 auto; padding: 4px 8px; border: 1px solid #dfc9b6; border-radius: 999px; color: var(--terracotta-dark); background: rgba(255, 255, 255, .66); font-size: .7rem; font-weight: 900; }
.goals-month { margin: 10px 0 2px; color: var(--ink); font-size: .82rem; font-weight: 900; }
.goals-intro { margin: 0; color: var(--muted); font-size: .78rem; }
.goal-form { display: flex; gap: 7px; margin: 16px 0 13px; }
.goal-form input { width: 100%; min-width: 0; height: 38px; border: 1px solid #d8c7b7; border-radius: 10px; padding: 0 11px; color: var(--ink); background: rgba(255,255,255,.88); outline: none; font: inherit; font-size: .78rem; transition: .16s ease; }
.goal-form input::placeholder { color: #a89789; }
.goal-form input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(142, 75, 57, .11); }
.goal-form button { flex: 0 0 auto; height: 38px; cursor: pointer; padding: 0 12px; border: 1px solid var(--terracotta); border-radius: 10px; color: #fff; background: var(--terracotta); font-size: .76rem; font-weight: 900; transition: .16s ease; }
.goal-form button:hover { border-color: var(--terracotta-dark); background: var(--terracotta-dark); }
.monthly-goals-list { display: grid; gap: 10px; }
.goals-empty { padding: 18px 12px; border: 1px dashed #d8c6b4; border-radius: 13px; color: var(--muted); text-align: center; background: rgba(255,255,255,.43); }
.goals-empty span { display: grid; width: 27px; height: 27px; place-items: center; margin: 0 auto 7px; border-radius: 50%; color: var(--gold); background: #fff5e2; font-size: 1.2rem; }
.goals-empty p { margin: 0; font-size: .77rem; line-height: 1.7; }
.monthly-goal { padding: 12px; border: 1px solid #e0d2c4; border-radius: 14px; background: rgba(255,255,255,.84); transition: border-color .18s ease, background .18s ease; }
.monthly-goal.is-complete { border-color: #d0dbc9; background: linear-gradient(130deg, #fbfcf9, #eff4ec); }
.goal-title-row, .goal-progress-row, .goal-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.goal-title-row h3 { margin: 0; min-width: 0; color: var(--ink); font-size: .82rem; line-height: 1.45; }
.is-complete .goal-title-row h3 { color: #61705f; text-decoration: line-through; text-decoration-color: #9eaf99; }
.goal-delete { width: 22px; height: 22px; display: grid; flex: 0 0 auto; place-items: center; cursor: pointer; border: 1px solid #e2d3c6; border-radius: 7px; color: #947666; background: transparent; font-size: 1.05rem; line-height: 1; transition: .16s ease; }
.goal-delete:hover { border-color: #bd5e4c; color: #fff; background: #bd5e4c; }
.goal-progress-row { margin: 11px 0 6px; color: var(--muted); font-size: .7rem; font-weight: 700; }
.goal-progress-row strong { color: var(--terracotta-dark); font-size: .74rem; }
.goal-slider { width: 100%; height: 6px; margin: 0; appearance: none; border-radius: 999px; outline: none; background: linear-gradient(to left, var(--terracotta) 0 var(--goal-progress), #e9dfd4 var(--goal-progress) 100%); cursor: pointer; }
.goal-slider::-webkit-slider-thumb { width: 15px; height: 15px; appearance: none; border: 2px solid #fff; border-radius: 50%; background: var(--terracotta); box-shadow: 0 1px 4px rgba(77, 46, 35, .25); }
.goal-slider::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: var(--terracotta); box-shadow: 0 1px 4px rgba(77, 46, 35, .25); }
.goal-actions { margin-top: 11px; }
.goal-actions button { flex: 1; min-height: 28px; cursor: pointer; border: 1px solid #e1d2c4; border-radius: 8px; color: var(--muted); background: #fffdf9; font-size: .65rem; font-weight: 800; transition: .16s ease; }
.goal-actions button:hover { color: var(--terracotta-dark); border-color: #cfab98; }
.goal-actions .goal-complete { color: #fff; border-color: var(--sage); background: var(--sage); }
.goal-actions .goal-complete:hover { border-color: #485a4d; background: #485a4d; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.day-note { gap: 10px; margin-top: 23px; padding: 14px 17px; border: 1px dashed #d8bda9; border-radius: var(--radius-md); color: #705b4c; background: rgba(255, 251, 245, .76); }
.day-note p { margin: 0; font-size: .84rem; }
.note-icon { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; color: var(--gold); border-radius: 50%; background: #fff2d6; }

.modal-open { overflow: hidden; }
.report-modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; }
.report-modal[hidden] { display: none; }
.report-backdrop { position: absolute; inset: 0; background: rgba(35, 30, 27, .54); backdrop-filter: blur(3px); }
.report-dialog { position: relative; z-index: 1; width: min(680px, 100%); max-height: min(820px, calc(100vh - 40px)); overflow-y: auto; padding: clamp(22px, 4vw, 34px); border: 1px solid rgba(255,255,255,.74); border-radius: 24px; background: #fffdf9; box-shadow: 0 28px 70px rgba(33, 26, 22, .25); }
.report-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.report-kicker { margin: 0 0 4px; color: var(--terracotta); font-size: .76rem; font-weight: 900; letter-spacing: .025em; }
.report-dialog h2 { font-size: clamp(1.45rem, 4vw, 2rem); }
.close-report { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font-size: 1.45rem; line-height: 1; transition: .16s ease; }
.close-report:hover { color: var(--terracotta-dark); border-color: #cfab98; }
.report-month { margin: 17px 0 3px; color: var(--ink); font-size: 1.01rem; font-weight: 900; }
.report-subtitle { margin: 0; color: var(--muted); font-size: .82rem; }
.report-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin: 21px 0; }
.report-stats article { min-height: 91px; display: flex; flex-direction: column; justify-content: space-between; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fcf9f4; }
.report-stats span { color: var(--muted); font-size: .71rem; font-weight: 700; }
.report-stats strong { color: var(--terracotta-dark); font-size: 1.25rem; line-height: 1.15; }
.report-stats .best-day { color: var(--ink); font-size: .79rem; line-height: 1.4; }
.report-section { margin-top: 23px; }
.report-section h3 { margin: 0 0 11px; font-size: .94rem; }
.report-categories { display: grid; gap: 8px; }
.report-category { padding: 10px 12px; border: 1px solid #eee5da; border-radius: 12px; background: #fff; }
.report-category-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 8px; color: var(--muted); font-size: .79rem; font-weight: 700; }
.report-category-head strong { color: var(--ink); font-size: .75rem; white-space: nowrap; }
.report-bar { height: 6px; overflow: hidden; border-radius: 999px; background: #eee7dd; }
.report-bar i { display: block; height: 100%; min-width: 0; border-radius: inherit; transition: width .35s ease; }
.top-task-list { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; }
.top-task-list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 11px; border-right: 3px solid var(--gold); border-radius: 9px; color: var(--muted); background: #fcf8f1; font-size: .81rem; }
.top-task-list strong { flex: 0 0 auto; color: var(--terracotta-dark); font-size: .76rem; }
.top-task-list .report-empty { display: block; border-right-color: var(--line); color: var(--muted); }

@media (max-width: 920px) {
  .content-layout { grid-template-columns: 1fr; }
  .monthly-goals { position: static; }
}

@media (max-width: 680px) {
  .app-shell { width: min(100% - 24px, 570px); padding-top: 18px; }
  .topbar { margin-bottom: 18px; }
  .topbar-actions { gap: 6px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 14px; }
  h1 { font-size: 1.42rem; }
  .reset-button { padding: 8px 10px; font-size: .75rem; }
  .reset-button svg { display: none; }
  .report-button { padding: 8px 10px; font-size: .75rem; }
  .report-button svg { display: none; }
  .hero { align-items: flex-start; flex-direction: column; gap: 20px; min-height: 0; padding: 27px 23px 23px; border-radius: 23px; }
  .hero h2 { font-size: 1.72rem; }
  .progress-card { width: 100%; justify-content: center; padding: 9px 14px; }
  .progress-ring { width: 84px; height: 84px; }
  .section-nav { margin: 19px 0 17px; }
  .task-list { grid-template-columns: 1fr; gap: 9px; }
  .task-card { min-height: 71px; padding: 12px; }
  .task-status { display: none; }
  .monthly-goals { padding: 17px; border-radius: 18px; }
  .goal-form { margin-bottom: 11px; }
  .report-modal { padding: 12px; }
  .report-dialog { max-height: calc(100vh - 24px); padding: 21px 18px; border-radius: 20px; }
  .report-stats { grid-template-columns: repeat(2, 1fr); }
  .report-stats article:last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
