
:root{
  --bg:#08101f;
  --bg2:#101a31;
  --panel:rgba(20,31,58,.96);
  --panel2:rgba(26,40,74,.98);
  --text:#eef3ff;
  --muted:#a9b8dd;
  --line:rgba(255,255,255,.08);
  --primary:#59b7ff;
  --primary2:#8ad0ff;
  --success:#77e1bc;
  --warning:#ffd166;
  --danger:#ff6b81;
  --shadow:0 18px 50px rgba(0,0,0,.28);
}
body.theme-sky{
  --bg:#071520;
  --bg2:#113251;
  --primary:#59b7ff;
  --primary2:#8ad0ff;
}
body.theme-midnight{
  --bg:#080c16;
  --bg2:#151d31;
  --primary:#89a7ff;
  --primary2:#b7c6ff;
}
body.theme-mint{
  --bg:#081915;
  --bg2:#14322b;
  --primary:#71d7c1;
  --primary2:#b5f1e5;
}
body.theme-sunset{
  --bg:#1a1011;
  --bg2:#381b22;
  --primary:#ff9f7a;
  --primary2:#ffcab1;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,system-ui,Arial,sans-serif;background:linear-gradient(180deg,var(--bg),var(--bg2));color:var(--text)}
button,input,select,textarea{font:inherit}
.page{max-width:1400px;margin:0 auto;padding:18px}
.hero,.card,.modal-card{
  background:linear-gradient(180deg,var(--panel),var(--panel2));
  border:1px solid var(--line);
  border-radius:28px;
  box-shadow:var(--shadow);
}
.hero{padding:22px;display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:18px}
.brand{display:flex;gap:16px;align-items:center}
.brand img{width:88px;height:88px;border-radius:22px;object-fit:cover;background:#59b7ff;padding:6px;box-shadow:var(--shadow)}
.hero h1{margin:0;font-size:2.35rem}
.hero p{margin:8px 0 0;color:var(--muted);max-width:780px}
.badges,.row,.day-bar,.preset-row,.theme-row,.tag-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.badge,.tag,.day-chip,.theme-chip{display:inline-flex;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid var(--line)}
.theme-chip,.day-chip{cursor:pointer}
.theme-chip.active,.day-chip.active{background:var(--primary);color:#061221}
.layout{display:grid;grid-template-columns:380px 1fr;gap:18px}
.left,.right{display:flex;flex-direction:column;gap:18px}
.card{padding:18px}
.card h2{margin:0 0 12px;font-size:1.2rem}
.card h3{margin:0 0 8px;font-size:1rem}
.section-head{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:12px}
.stack{display:flex;flex-direction:column;gap:10px}
.grid2,.grid3,.stats-grid{display:grid;gap:10px}
.grid2{grid-template-columns:1fr 1fr}
.grid3{grid-template-columns:repeat(3,1fr)}
.stats-grid{grid-template-columns:repeat(4,1fr)}
input,select,textarea{
  width:100%;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.055);
  color:var(--text);
  outline:none;
}
textarea{min-height:120px;resize:vertical}
label{display:block;font-size:.86rem;color:var(--muted);margin-bottom:6px}
button{
  border:none;border-radius:16px;padding:12px 14px;min-height:46px;font-weight:800;
  cursor:pointer;background:var(--primary);color:#071120
}
button.secondary{background:rgba(255,255,255,.08);color:var(--text)}
button.danger{background:var(--danger);color:white}
button.ghost{background:transparent;border:1px solid var(--line);color:var(--text)}
.hidden{display:none !important}
.status{margin:0;font-weight:700}
.status.ok{color:var(--success)}
.status.warn{color:var(--warning)}
.status.muted{color:var(--muted)}
.timeline,.task-list,.insight-list{display:flex;flex-direction:column;gap:10px}
.timeline-row,.task-card,.insight,.streak-card{
  border:1px solid var(--line);border-radius:18px;padding:14px;background:rgba(255,255,255,.03)
}
.timeline-row{display:grid;grid-template-columns:86px 1fr auto;gap:12px;align-items:start}
.time{color:#b7cdff;font-weight:800}
.task-card{display:grid;grid-template-columns:1fr auto;gap:14px}
.task-card h3{margin:0 0 4px}
.small{font-size:.86rem;color:var(--muted)}
.empty{color:var(--muted);padding:10px 0}
.stats-grid .stat-box{border:1px solid var(--line);border-radius:18px;padding:14px;background:rgba(255,255,255,.03)}
.stat-label{display:block;color:var(--muted);font-size:.84rem;margin-bottom:6px}
.stat-value{font-size:1.55rem;font-weight:900}
.bar-row{display:grid;grid-template-columns:120px 1fr auto;gap:10px;align-items:center;margin-top:10px}
.bar-bg{height:12px;border-radius:999px;background:rgba(255,255,255,.05);border:1px solid var(--line);overflow:hidden}
.bar-fill{height:100%;background:linear-gradient(90deg,var(--primary),var(--primary2))}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.56);display:none;align-items:center;justify-content:center;padding:18px;z-index:20}
.modal.show{display:flex}
.modal-card{width:min(760px,100%);padding:22px}
.check-row{display:flex;align-items:center;gap:8px;color:var(--muted)}
.check-row input{width:auto}
.heat-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.heat-cell{height:32px;border-radius:10px;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font-size:.8rem;color:var(--muted)}
.level-badge{font-weight:900;color:#071120;background:var(--primary);padding:8px 12px;border-radius:999px}
@media (max-width:980px){.layout{grid-template-columns:1fr}}
@media (max-width:760px){
  .grid2,.grid3,.stats-grid{grid-template-columns:1fr}
  .timeline-row,.task-card,.bar-row{grid-template-columns:1fr}
  .brand{align-items:flex-start}
  .brand img{width:72px;height:72px}
}

.tabbar{display:flex;gap:10px;flex-wrap:wrap;padding:12px 14px;margin-bottom:18px}
.tab-btn{background:rgba(255,255,255,.08);color:var(--text)}
.tab-btn.active{background:var(--primary);color:#071120}
.tab-panel.active{display:block}
.calendar-layout,.profile-layout{display:flex;flex-direction:column;gap:18px}
.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:10px}
.calendar-card{
  border:1px solid var(--line);border-radius:18px;padding:14px;background:rgba(255,255,255,.03);text-align:left;
  color:var(--text);min-height:120px
}
.calendar-card.active{outline:2px solid var(--primary)}
.calendar-title{font-weight:800;margin-bottom:8px}
.profile-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.profile-item{border:1px solid var(--line);border-radius:18px;padding:14px;background:rgba(255,255,255,.03)}
.profile-value{font-size:1.2rem;font-weight:800}
@media (max-width:760px){
  .calendar-grid,.profile-grid{grid-template-columns:1fr}
}
