/* Simple Notepad-style TODO - Black/White/Red */
:root{
  --bg:#0b0b0f;
  --panel:#14141c;
  --panel2:#101017;
  --text:#ffffff;
  --muted:#b8b8c6;
  --line:rgba(255,255,255,.10);
  --red:#ff2a3f;
  --red2:#ff5a6a;
  --radius:14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background: linear-gradient(180deg, #0f0f15, var(--bg));
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  padding:16px clamp(12px, 3vw, 22px);
  border-bottom:1px solid var(--line);
  background: rgba(11,11,15,.96);
}

.brand{display:flex; gap:12px; align-items:center}
.dot{
  width:12px; height:12px; border-radius:999px;
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(255,42,63,.14);
}
.brand h1{margin:0; font-size:16px}
.brand p{margin:3px 0 0; color:var(--muted); font-size:12px}

.actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}

.wrap{
  padding:16px clamp(12px, 3vw, 22px) 28px;
  display:grid;
  grid-template-columns: 300px 1fr;
  gap:14px;
}

.panel{
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:14px;
}

.panel-head h2{margin:0 0 10px; font-size:14px; color:var(--muted); font-weight:900; letter-spacing:.3px}

.input, .select{
  width:100%;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:12px 12px;
  outline:none;
}
.input::placeholder{color:rgba(184,184,198,.75)}
.select{padding:12px 10px}

.btn{
  cursor:pointer;
  border:none;
  border-radius:12px;
  padding:12px 14px;
  background: var(--red);
  color:#fff;
  font-weight:900;
}
.btn:hover{opacity:.95}
.btn.ghost{
  background: rgba(255,255,255,.05);
  border:1px solid var(--line);
}
.btn.danger{background: var(--red2)}

.cat-add{display:flex; gap:8px}
.cats{display:flex; flex-direction:column; gap:8px; margin-top:10px}

.cat{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  cursor:pointer;
}
.cat.active{border-color: rgba(255,42,63,.45); background: rgba(255,42,63,.10)}
.cat .name{font-weight:900}
.cat .x{
  width:26px; height:26px; display:grid; place-items:center;
  border-radius:10px;
  border:1px solid rgba(255,42,63,.25);
  background: rgba(255,42,63,.10);
  color:#fff;
  font-weight:900;
}
.cat.all .x{opacity:.35; border-color: var(--line); background: rgba(255,255,255,.03)}

.mini{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}
.mini div{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  background: rgba(255,255,255,.02);
  text-align:center;
}
.mini b{display:block; font-size:16px}
.mini span{display:block; margin-top:3px; font-size:12px; color:var(--muted)}

.hint{margin:12px 0 0; color:var(--muted); font-size:12px; line-height:1.4}

.main{min-height:520px}
.toolbar{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.filters{display:flex; gap:8px; flex-wrap:wrap; flex:1}
.active{display:flex; align-items:center; justify-content:flex-end}
.badge{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
  font-weight:900;
}

.add-row{display:flex; gap:8px}
.grow{flex:1}

.list{
  list-style:none;
  padding:0;
  margin:12px 0 0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background: rgba(255,255,255,.02);
}
.cb{
  width:20px; height:20px;
  border-radius:6px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
  cursor:pointer;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  margin-top:2px;
}
.item.done .cb{
  background: var(--red);
  border-color: rgba(255,42,63,.55);
}
.cb svg{width:14px; height:14px; opacity:0; transform:scale(.8); transition:.12s; fill:#0b0b0f}
.item.done .cb svg{opacity:1; transform:scale(1)}

.text{flex:1; min-width:0}
.title{
  font-weight:900;
  margin:0;
  line-height:1.35;
  word-break:break-word;
}
.item.done .title{opacity:.72; text-decoration:line-through}
.meta{margin-top:4px; color:var(--muted); font-size:12px; display:flex; gap:8px; flex-wrap:wrap}

.tools{display:flex; gap:6px; flex:0 0 auto}
.icon{
  cursor:pointer;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:#fff;
  border-radius:10px;
  padding:10px;
  font-weight:900;
}
.icon:hover{border-color: rgba(255,42,63,.35)}
.icon.danger:hover{background: rgba(255,42,63,.10); border-color: rgba(255,42,63,.35)}

.editbox{
  width:100%;
  margin-top:6px;
  display:none;
  gap:6px;
}
.editbox .input{padding:10px 10px}
.editbox .btn{padding:10px 12px}
.item.editing .editbox{display:flex}

.empty{display:none; margin-top:18px; text-align:center; color:var(--muted)}
.empty h3{margin:0 0 6px; color:#fff}

.toast{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:16px;
  min-width: 220px;
  max-width: calc(100vw - 24px);
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(20,20,28,.96);
  color: var(--muted);
  display:none;
  font-size:12px;
}
.toast.show{display:block; animation: pop .14s ease-out}
@keyframes pop{from{transform:translateX(-50%) translateY(6px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}

@media (max-width: 920px){
  .wrap{grid-template-columns:1fr}
  .main{min-height:unset}
}


/* --- Fix: dropdown (select) menu colors --- */
select.select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.75) 50%),
    linear-gradient(135deg, rgba(255,255,255,.75) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

/* Dropdown list (options) */
select.select option{
  background: #14141c;   /* panel */
  color: #ffffff;
}

/* Better focus */
.input:focus, .select:focus{
  border-color: rgba(255,42,63,.55);
  box-shadow: 0 0 0 4px rgba(255,42,63,.14);
}

/* Ensure placeholder readable in all browsers */
input::placeholder{
  opacity: 1;
}

/* Date/time pickers (if browser applies) */
input, select, button{
  color-scheme: dark;
}
