:root{
  --bg: #0c0f14;
  --card: #111724;
  --card2:#0f1520;
  --ink:#eaf0ff;
  --muted:#9fb0d2;
  --line:#24304a;
  --shadow: rgba(0,0,0,.35);

  --btn:#1b2740;
  --btn2:#243659;
  --danger:#ff4d4d;
  --accent:#5b8cff;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: Rubik, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: radial-gradient(1000px 500px at 20% 0%, #142033 0%, var(--bg) 60%);
  color:var(--ink);
  pointer-events: all;
  padding:0;
}

#container {
    opacity:1;
    pointer-events:all;
    height:100%;
    margin:0;
    max-width:none;
    max-height:none;
}

#dashboard {
    max-height: none;
  height: 100%;
  padding: 0;
}

.authSection input {
    color: #333 !important;
}

h1,h2,h3{ margin:0; font-weight:700; }
.subtle{ color:var(--muted); }
.small{ font-size:.85rem; }

.alertDiv{
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  background: #0f1a2b;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 9999;
}
.alertDiv.showAlert{ opacity:1; pointer-events:auto; }
.alertDiv p{ margin:0; }
.alertDiv button{
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}

.authSection{
  max-width: 420px;
  margin: 10vh auto;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px var(--shadow);
}
.authSection input{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: var(--card2);
  color: var(--ink);
  margin: 10px 0;
}
.authBtns{
  display:flex;
  gap:10px;
}

.plannerShell{
  margin: 0px auto;
  padding: 0 0 20px;
}

.plannerTopbar{
  display:block;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 16px 16px;
  border-bottom-right-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #101a2b, #0d131f);
  box-shadow: 0 10px 30px var(--shadow);
  max-width:200px;
  height:100%;
  margin-right: 10px;
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
}
.brandMark{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius: 14px;
  background: #0f1b2d;
  border: 1px solid var(--line);
}
.brand .subtle{ font-size:.9rem; margin-top:4px; }

.topbarControls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pillGroup{
  display:flex;
  padding:4px;
  border-radius: 999px;
  background: #0f1b2d;
  border: 1px solid var(--line);
}
.pill{
  border:none;
  background:transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor:pointer;
}
.pill.active{
  background: #192a49;
  color: var(--ink);
}

.btn{
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 12px;
  cursor:pointer;
}
.btn:hover{ background: var(--btn2); }
.btn.primary{
  background: var(--accent);
  border-color: transparent;
  color: #071021;
  font-weight:700;
}
.btn.danger{
  background: #2a0f15;
  border-color: #551b28;
  color: #ffd2d2;
}
.btn.danger:hover{ background:#3a141d; }

.iconBtn{
  border: 1px solid var(--line);
  background: #0f1b2d;
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor:pointer;
  font-size: 18px;
  line-height: 1;
}
.iconBtn:hover{ background:#14233b; }

.plannerBody{
  display: inline-grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  margin-top: 1px;
  width: calc(100% - 210px);
}
.plannerMain{
  border:1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  overflow:hidden;
}
.dayPanel{
  border:1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  overflow:hidden;
  min-height: 640px;
}

.monthBar{
  display:flex;
  gap:12px;
  align-items:center;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  background: #0f1b2d;
}
.monthNav{ display:flex; gap:8px; }

.monthTitle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  gap:14px;
}
.monthTitle h2{ font-size: 18px; }
.calPicker{
  display:flex;
  gap:10px;
  align-items:center;
}
select{
  border:1px solid var(--line);
  background: #0b1424;
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 10px;
  min-width: 220px;
}

.viewWrap{ padding: 14px; }

.dowRow{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:10px;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: .9rem;
}
.calendarGrid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:10px;
  padding: 0 14px 14px;
}
.dayCell{
  background: #0f1520;
  border:1px solid var(--line);
  border-radius: 16px;
  min-height: 110px;
  padding: 10px;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.dayCell:hover{ background:#121c2a; }
.dayCell.muted{ opacity:.55; }
.dayCell.selected{ outline: 2px solid var(--accent); }

.dayNumRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.dayNum{
  font-weight:800;
  letter-spacing: .5px;
}
.dotRow{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.dot{
  width:10px;
  height:10px;
  border-radius: 50%;
  border:1px solid rgba(255,255,255,.25);
}
.more{
  color: var(--muted);
  font-size: .85rem;
}

.listWrap{
  padding: 0 14px 14px;
}
.listDay{
  border:1px solid var(--line);
  background: #0f1520;
  border-radius: 16px;
  margin-bottom: 12px;
  overflow:hidden;
}
.listDayHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-bottom:1px solid var(--line);
  background:#0f1b2d;
}
.listItems{ padding: 10px 12px; }
.listItem{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 8px 8px;
  border-radius: 12px;
  cursor:pointer;
}
.listItem:hover{ background:#14233b; }
.timeChip{
  font-family: Roboto Mono, ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  min-width: 74px;
  font-size:.9rem;
}
.catPill{
  font-size:.78rem;
  padding: 4px 8px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.18);
  color: var(--ink);
  opacity:.95;
}

.dayPanelHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding: 14px;
  border-bottom:1px solid var(--line);
  background:#0f1b2d;
}
.dayPanelActions{
  padding: 14px;
  border-bottom:1px solid var(--line);
}
.dayItems{ padding: 10px 14px 14px; }

.dayItemCard{
  border:1px solid var(--line);
  background: #0f1520;
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
}
.dayItemTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.dayItemTitle{
  display:flex;
  gap:10px;
  align-items:center;
}
.dayItemTitle strong{ font-size: 1rem; }
.dayItemMeta{
  margin-top: 6px;
  color: var(--muted);
  font-size:.9rem;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.mono{
  font-family: Roboto Mono, ui-monospace, SFMono-Regular, Menlo, monospace;
}

.modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  display:none;
  place-items:center;
  z-index: 9990;
  padding: 20px;
}
.modal.open{ display:grid; }
.modalCard{
  width: min(720px, 96vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 40px var(--shadow);
  overflow:hidden;
}
.modalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px;
  background:#0f1b2d;
  border-bottom:1px solid var(--line);
}
.modalBody{ padding: 14px 16px; }
.modalFoot{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 14px 16px;
  border-top:1px solid var(--line);
  background:#0f1b2d;
}
.spacer{ flex:1; }

.formRow{ display:flex; flex-direction:column; gap:6px; margin-bottom: 12px; }
.formRow label{ color: var(--muted); font-size:.9rem; }
input, textarea, select{
  border:1px solid var(--line);
  background: #0b1424;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
}
textarea{ resize: vertical; min-height: 90px; }
.formGrid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

.catsCreate{
  display:grid;
  grid-template-columns: 1fr 54px 110px;
  gap:10px;
  align-items:center;
  margin-bottom: 12px;
}
.catsList{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.catRow{
  display:grid;
  grid-template-columns: 1fr 140px;
  gap:10px;
  align-items:center;
  border:1px solid var(--line);
  border-radius: 16px;
  background:#0f1520;
  padding: 10px;
}
.catRowLeft{
  display:flex;
  gap:10px;
  align-items:center;
}
.catSwatch{
  width:14px; height:14px; border-radius: 50%;
  border:1px solid rgba(255,255,255,.25);
}
.catRow input[type="text"]{ width:100%; }
.catRowRight{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  align-items:center;
}

@media (max-width: 1100px){
  .plannerBody{ grid-template-columns: 1fr; }
  .dayPanel{ min-height: auto; }
}
