:root{
  --bg:#f2f3f6;--card:#fff;--text:#101114;--muted:#6e7480;--line:#e8e9ed;
  --green:#118a45;--soft-green:#eaf8f0;--orange:#ff7a00;--shadow:0 18px 45px rgba(20,25,30,.08)
}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.shell{min-height:100vh;display:grid;grid-template-columns:220px minmax(680px,1fr) 360px;background:#fff;border:1px solid #e4e4e7;border-radius:24px;overflow:hidden}
.sidebar{border-right:1px solid var(--line);display:flex;flex-direction:column;padding:30px 24px;gap:32px;background:#fff}
.brand{font-size:42px;font-weight:950;color:#087a3d;line-height:1;padding-left:20px}
.menu{display:flex;flex-direction:column;gap:12px}
.menu-item{border:0;background:transparent;border-radius:18px;padding:16px 18px;display:flex;align-items:center;gap:14px;font-weight:800;color:#23262d;cursor:pointer;text-align:left;transition:.15s ease}
.menu-item span{width:22px;text-align:center}.menu-item:hover,.menu-item.active{background:var(--soft-green);color:#087a3d}
.profile{margin-top:auto;border-top:1px solid var(--line);padding-top:22px;display:flex;align-items:center;gap:12px}
.avatar{width:42px;height:42px;border-radius:50%;background:#111;color:white;display:grid;place-items:center;font-weight:900}.profile p{margin:2px 0 0;color:var(--muted);font-size:13px}
.main{padding:44px 42px;min-width:0}.right-panel{border-left:1px solid var(--line);padding:42px 36px;background:#fff}
.topbar,.section-title,.habit-title,.side-head{display:flex;justify-content:space-between;align-items:center;gap:20px}
.kicker{margin:0 0 8px;color:#087a3d;font-size:14px;font-weight:900}.kicker.light{color:rgba(255,255,255,.74);text-transform:uppercase;letter-spacing:.09em;font-size:12px}
h1{font-size:44px;letter-spacing:-.04em;line-height:1;margin:0}h2,h3,p{margin-top:0}
.top-actions{display:flex;gap:14px;flex-wrap:wrap}button{font:inherit}
.outline-btn,.green-btn,.black-btn{border:0;border-radius:14px;padding:14px 22px;font-weight:900;cursor:pointer}
.outline-btn{background:#fff;border:1px solid #dfe2e7;color:#111}.green-btn{background:linear-gradient(135deg,#109a52,#057a38);color:#fff;box-shadow:0 12px 28px rgba(6,126,61,.25)}.black-btn{background:#111;color:#fff;border-radius:999px}
.notice{padding:14px 18px;border-radius:16px;margin:22px 0 0;font-weight:800;background:#fff8e8;border:1px solid #ffe1a8;color:#745000}.hidden{display:none!important}
.summary-grid{display:grid;grid-template-columns:1.75fr .8fr .8fr;gap:28px;margin:42px 0}
.streak-card,.metric-card,.side-card,.quote-card,.big-calendar-card,.stat-card{border-radius:26px;box-shadow:var(--shadow)}
.streak-card{min-height:255px;padding:34px;color:#fff;background:linear-gradient(135deg,#35a866,#7bc99b);display:flex;justify-content:space-between;align-items:center;overflow:hidden}
.streak-row{display:flex;align-items:center;gap:20px;margin:26px 0 16px}
.fire-box,.icon-box{width:70px;height:70px;border-radius:18px;display:grid;place-items:center;font-size:32px;background:#fff;box-shadow:0 10px 22px rgba(0,0,0,.12)}
.streak-card h2{font-size:46px;letter-spacing:-.04em;margin:0}.streak-card p:last-child{max-width:360px;font-weight:600;line-height:1.65}.line-chart{width:220px;min-width:180px}.line-chart polyline{fill:none;stroke:white;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;opacity:.8}.line-chart circle{fill:white}
.metric-card{padding:32px;min-height:255px;display:flex;flex-direction:column;justify-content:center}.metric-card.warm{background:linear-gradient(135deg,#fff7ef,#fff)}.metric-card.cool{background:linear-gradient(135deg,#effaf5,#fff)}
.metric-card p{font-size:20px;font-weight:800;margin:20px 0 18px}.metric-card strong{font-size:48px;letter-spacing:-.05em}.metric-card span{color:var(--muted)}
.icon-box{width:58px;height:58px;font-size:27px}.icon-box.orange{color:var(--orange);background:#fff0df}.icon-box.green{color:var(--green);background:#e7f7ee}
.section-title{margin-bottom:22px}.section-title h2{font-size:28px;letter-spacing:-.03em;margin:0}.section-title p{color:var(--muted);margin:0;font-weight:700}
.category-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:18px;margin-bottom:42px}
.category-card{border-radius:22px;padding:22px 20px;min-height:180px;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.04)}
.cat-icon{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;font-size:24px;margin-bottom:18px}.category-card h3{font-size:17px;margin:0 0 10px}.category-card strong{font-size:32px;letter-spacing:-.04em}.category-card small{color:var(--muted);font-weight:800}.cat-progress,.progress-track{height:8px;background:rgba(0,0,0,.08);border-radius:999px;overflow:hidden;margin-top:12px}.cat-fill,.progress-fill{height:100%;border-radius:999px}
.habit-title{margin-top:12px;margin-bottom:18px}.habit-table-wrap{background:white;border-radius:24px;overflow:auto;border:1px solid var(--line)}.habit-table{width:100%;border-collapse:collapse;min-width:760px}
.habit-table th{color:#868b96;font-size:12px;text-transform:uppercase;letter-spacing:.06em;text-align:left;padding:18px}.habit-table td{border-top:1px solid var(--line);padding:18px;vertical-align:middle}
.check{width:24px;height:24px;border:2px solid #cfd3da;border-radius:8px;display:grid;place-items:center;color:white;cursor:pointer}.check.done{background:#28a463;border-color:#28a463}.habit-name{display:flex;align-items:center;gap:14px}.habit-mini-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;font-size:20px}.habit-name strong{display:block;margin-bottom:4px}.habit-name span{color:var(--muted);font-size:14px}.pill{display:inline-flex;padding:8px 14px;border-radius:999px;font-weight:900;font-size:13px}.streak-text{font-weight:900;white-space:nowrap}.more-btn{border:0;background:transparent;font-size:22px;color:#9aa0aa;cursor:pointer}
.right-panel h2{font-size:30px;margin-bottom:4px}.side-card,.quote-card,.big-calendar-card,.stat-card{padding:24px;margin-top:24px;border:1px solid var(--line);background:#fff}.side-card h3{font-size:24px;margin:8px 0}.progress-fill{width:0%;background:var(--green)}
.week-labels,.month-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;text-align:center}.week-labels{color:#9ca2ad;font-size:11px;font-weight:900;text-transform:uppercase;margin:18px 0 10px}.week-labels.big{font-size:13px}.day-dot{height:32px;border-radius:50%;display:grid;place-items:center;font-size:13px;color:#252930;position:relative}.day-dot.good::after{content:"";width:4px;height:4px;border-radius:50%;background:#2bbd6d;position:absolute;bottom:2px}.day-dot.today{background:#159653;color:#fff;font-weight:900}.day-dot.empty{opacity:0}.big-grid .day-dot{height:58px;border-radius:18px;background:#f7f8fa}.big-grid .day-dot.today{background:#159653;color:#fff}.big-grid .day-dot.empty{background:transparent}
.legend{display:flex;align-items:center;gap:8px;color:var(--muted);font-weight:800}.legend span{width:10px;height:10px;border-radius:50%;background:#2bbd6d}.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:18px;margin-bottom:28px}.stat-card{margin-top:0}.stat-card strong{font-size:36px}
.top-list{margin:18px 0 0;padding:0;list-style:none;display:grid;gap:14px}.top-item{display:grid;grid-template-columns:24px 1fr auto;gap:10px;align-items:center;font-size:14px}.top-rank{color:#6e7480;font-weight:900}.top-name{font-weight:900}.top-days{font-size:12px;color:#6e7480;font-weight:900}
.quote-card{display:flex;gap:18px;align-items:center;background:linear-gradient(135deg,#fff,#f8fbf9)}.star{width:54px;height:54px;border-radius:50%;background:#dff5e8;color:#0b8b43;display:grid;place-items:center;font-size:28px;flex:none}.quote-card p{margin:0;line-height:1.55;font-weight:700}.muted{color:var(--muted)}
dialog{border:0;border-radius:24px;padding:0;box-shadow:0 28px 90px rgba(0,0,0,.24)}.modal-card{padding:28px;width:min(480px,92vw);display:grid;gap:16px}label{display:grid;gap:8px;font-weight:900}input,select{padding:14px 16px;border:1px solid #dfe2e7;border-radius:14px;font:inherit}menu{display:flex;justify-content:flex-end;gap:10px;padding:0;margin:8px 0 0}.category-edit-list{display:grid;gap:10px}.category-row{display:flex;justify-content:space-between;align-items:center;background:#f6f7f8;border-radius:16px;padding:12px 14px}.danger{border:0;border-radius:999px;padding:9px 13px;background:#fff0f0;color:#b00020;font-weight:900;cursor:pointer}
@media(max-width:1200px){.shell{grid-template-columns:92px 1fr}.sidebar{padding:28px 16px}.menu-item{justify-content:center;padding:16px 10px;font-size:0}.menu-item span{font-size:20px}.profile{display:none}.right-panel{grid-column:1/-1;border-left:0;border-top:1px solid var(--line)}.summary-grid{grid-template-columns:1fr 1fr}.streak-card{grid-column:1/-1}}
@media(max-width:850px){.shell{display:block;border-radius:0}.sidebar{position:sticky;top:0;z-index:5;flex-direction:row;align-items:center;overflow:auto;border-right:0;border-bottom:1px solid var(--line)}.brand{padding-left:0}.menu{flex-direction:row}.main,.right-panel{padding:28px 20px}.topbar,.section-title{align-items:flex-start;flex-direction:column}h1{font-size:36px}.summary-grid{grid-template-columns:1fr}.line-chart{display:none}}

.history-btn{color:#0b8b43}
.delete-btn{color:#b00020}
.big-calendar-card{margin-top:0;margin-bottom:28px}
#habitHistoryGrid .day-dot.good{background:#159653;color:#fff;font-weight:900}
#habitHistoryGrid .day-dot.good::after{display:none}


.login-screen{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:linear-gradient(135deg,#eaf8f0,#f2f3f6);
}

.login-card{
  width:min(420px,94vw);
  background:#fff;
  border:1px solid var(--line);
  border-radius:30px;
  box-shadow:var(--shadow);
  padding:36px;
  display:grid;
  gap:16px;
}

.login-logo{
  width:64px;
  height:64px;
  border-radius:20px;
  background:#087a3d;
  color:white;
  display:grid;
  place-items:center;
  font-size:42px;
  font-weight:950;
}

.login-card h1{
  font-size:36px;
  margin:0;
}

#pinInput{
  text-align:center;
  font-size:28px;
  letter-spacing:.4em;
  font-weight:900;
}

.login-error{
  background:#fff0f0;
  color:#b00020;
  border:1px solid #ffc9c9;
  border-radius:14px;
  padding:12px 14px;
  font-weight:800;
  margin:0;
}
