*{box-sizing:border-box}
:root{
  --bg:#090b10; --card:#111621; --muted:#9aa6b2; --text:#e9eef4; --accent:#20d3c2;
  --border:#233043; --note:#0d1320; --danger:#ef4444;
  --red:#ef4444; --orange:#f59e0b; --yellow:#fbbf24; --green:#22c55e; --cyan:#06b6d4;
  --blue:#3b82f6; --violet:#8b5cf6; --white:#ffffff; --black:#000000;
}
html,body{margin:0;height:100%}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text)}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--border);background:#0b0f17;position:sticky;top:0;z-index:10}
.profile{display:flex;align-items:center;gap:10px}
.avatar{width:38px;height:38px;border-radius:12px;border:1px solid var(--border);object-fit:cover;background:#0f1522}
.pmeta{display:flex;flex-direction:column}
.pname{font-weight:800}
.psub{font-size:12px;color:var(--muted)}
.actions{display:flex;gap:8px}
button{background:#0e1422;border:1px solid var(--border);color:var(--text);border-radius:10px;padding:8px 12px;cursor:pointer}
button:hover{filter:brightness(1.1)}
button.danger{border-color:#3b1c1c;background:#1a0e0e;color:#ff9b9b}
.importLabel{display:inline-flex;gap:8px;align-items:center}
.importLabel input{display:none}
.layout{display:grid;grid-template-columns:240px 1fr;height:calc(100vh - 60px)}
.sidebar{border-right:1px solid var(--border);padding:12px;display:flex;flex-direction:column;gap:6px;background:#0b0f17}
.tab{width:100%;text-align:left;padding:10px 12px;border-radius:10px;border:1px solid var(--border);background:#0f1522}
.tab.active{outline:2px solid var(--accent)}
.tab.home{background:#10182a}
.tab.event{margin-top:8px;background:#141c2b}
.sep{margin:6px 4px;color:var(--muted);font-size:12px}
.spacer{flex:1}
.days{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.daybtn{padding:10px;border-radius:10px;border:1px solid var(--border);font-weight:800;cursor:pointer;position:relative}
.daybtn.todays{box-shadow:0 0 0 2px var(--accent) inset, 0 0 16px rgba(32,211,194,.5)}
.daybtn.active::after{content:'';position:absolute;inset:-3px;border-radius:12px;box-shadow:0 0 0 2px rgba(32,211,194,.6)}
.content{padding:14px;overflow:auto}
.view{display:none}
.view.active{display:block}
.card{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:12px}
.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.row{display:flex;gap:8px;flex-wrap:wrap}
.muted{color:var(--muted)}
.mark{color:var(--accent);font-weight:800}
.dayHeader{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.numWrap{width:92px;height:92px;border-radius:16px;border:2px solid var(--border);display:flex;align-items:center;justify-content:center}
.num{font-size:58px;font-weight:900}
.headMeta{flex:1}
.title{display:flex;align-items:center;gap:10px}
.bigName{font-size:32px;font-weight:900}
.nameEdit{font-size:28px;background:#0f1522;color:var(--text);border:1px solid var(--border);border-radius:8px;padding:4px 8px}
.sub{color:var(--muted)}
.gridMain{display:grid;grid-template-columns:1.5fr 1fr;gap:12px}
.lists{display:flex;flex-direction:column;gap:12px}
.listRow{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.listCard{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:10px}
.listTitle{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.listTitle .ttl{font-weight:800}
.listTitle .add{width:34px;height:28px;border-radius:8px}
.items{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.item{display:grid;grid-template-columns:auto 1fr auto auto auto;gap:8px;align-items:center;background:#0f1522;border:1px solid var(--border);border-radius:10px;padding:6px}
.item input[type="checkbox"]{width:18px;height:18px}
.item input[type="text"]{background:#0c1220;border:1px solid var(--border);color:var(--text);border-radius:8px;padding:6px 8px;width:100%}
.stars{display:flex;gap:4px}
.star{width:18px;height:18px;border-radius:4px;background:#0c1220;border:1px solid var(--border);text-align:center;line-height:18px;font-size:12px;cursor:pointer}
.star.on{background:#112b1f;border-color:#1f6b4b}
.arch{background:#0f1a11;border-color:#1f6b4b;color:#9ff0c7;border-radius:8px;padding:6px 8px}
.del{background:#1d1111;border-color:#3b1c1c;color:#f7b0b0;border-radius:8px;padding:6px 8px}
.miniTriples{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.triple{background:#0f1522;border:1px solid var(--border);border-radius:12px;padding:8px}
.tHead{font-size:12px;color:var(--muted);margin-bottom:6px}
.trow{width:100%;background:#0c1220;border:1px solid var(--border);color:var(--text);border-radius:8px;padding:6px;resize:vertical}
.notes{background:#0d1320;border:1px solid var(--border);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:8px}
.notesHead{font-weight:900;letter-spacing:.6px}
.noteToolbar{display:flex;gap:8px;flex-wrap:wrap}
.noteToolbar button{font-size:12px;padding:6px 8px}
.noteBox{min-height:360px;background:#0b0f17;border:1px dashed var(--border);border-radius:10px;padding:10px;line-height:1.6}
.singleHeader{font-size:26px;font-weight:900;margin-bottom:8px}
.single .singleBody{display:flex;flex-direction:column;gap:12px}
.eventHeader{font-size:22px;font-weight:900;margin-bottom:8px}
.eventForm{display:grid;grid-template-columns:2fr 1fr 1fr auto auto;gap:8px;align-items:center}
.chk{display:flex;gap:6px;align-items:center;color:var(--muted)}
.events{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.events li{display:grid;grid-template-columns:1fr auto auto auto;align-items:center;gap:8px;background:#0f1522;border:1px solid var(--border);border-radius:10px;padding:8px}
.badge{background:#0b1322;border:1px solid var(--border);border-radius:8px;padding:4px 8px;font-size:12px;color:var(--muted)}
/* Stats + tables */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}
.stat{background:#0f1522;border:1px solid var(--border);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:4px}
.stat .k{font-size:24px;font-weight:900}
.stat.green .k{color:#22c55e}
.stat.orange .k{color:#f59e0b}
.stat.red .k{color:#ef4444}
#reportTable,#lifeReportTable{width:100%;border-collapse:collapse}
#reportTable th,#reportTable td,#lifeReportTable th,#lifeReportTable td{border:1px solid var(--border);padding:6px 8px;color:var(--text)}
/* Links */
.linksGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:12px}
.linkCard{background:#0f1522;border:1px solid var(--border);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:8px;align-items:center}
.linkThumb{width:100%;aspect-ratio:1/1;border:1px dashed var(--border);border-radius:10px;background:#0b0f17;display:flex;align-items:center;justify-content:center;overflow:hidden}
.linkThumb img{width:100%;height:100%;object-fit:cover}
.linkActions{display:flex;gap:8px}
/* Life */
.lifeLists{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.life .listCard .items .item{grid-template-columns:auto 1fr auto auto auto}
.lifeReport{margin-top:12px}
@media(max-width:1100px){
  .gridMain{grid-template-columns:1fr}
  .listRow{grid-template-columns:1fr}
  .lifeLists{grid-template-columns:1fr}
}
