:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e2e8f0;
  --primary:#2563eb;
  --primary-2:#1d4ed8;
  --danger:#b91c1c;
  --danger-2:#991b1b;
  --shadow: 0 8px 24px rgba(15,23,42,.08);
  --radius: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}

a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo{
  width:40px; height:40px;
  border-radius:12px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  box-shadow: var(--shadow);
}

.brand h1{
  font-size: 22px;
  margin:0;
  letter-spacing:.2px;
}

.page-title{
  font-size: 34px;
  margin: 8px 0 6px;
}

.subtitle{
  margin:0 0 18px;
  color:var(--muted);
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card + .card{ margin-top: 14px; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

.section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 10px;
  font-size: 18px;
}

.label{
  display:block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 10px 0 6px;
}

input, select{
  width:100%;
  padding: 11px 12px;
  border:1px solid var(--border);
  border-radius: 12px;
  outline:none;
  background:#fff;
  color:var(--text);
}
input:focus, select:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 12px;
  border:1px solid transparent;
  border-radius: 12px;
  background: var(--primary);
  color:#fff;
  font-weight: 700;
  cursor:pointer;
}
.btn:hover{ background: var(--primary-2); }
.btn:active{ transform: translateY(1px); }

.btn-secondary{
  background:#fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover{ background:#f8fafc; }

.btn-danger{
  background: var(--danger);
}
.btn-danger:hover{ background: var(--danger-2); }

.row{
  display:flex;
  gap: 12px;
  align-items:center;
  flex-wrap:wrap;
}
.row > *{ flex:1; min-width: 180px; }

.kv{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.kv code{
  display:block;
  width:100%;
  padding: 10px 12px;
  background:#0b1220;
  color:#e2e8f0;
  border-radius: 12px;
  overflow:auto;
}
.small{ font-size: 12px; color: var(--muted); }

.hr{
  height:1px;
  background: var(--border);
  margin: 14px 0;
}

.list{
  list-style:none;
  padding:0;
  margin:0;
}
.item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.item:first-child{ border-top:0; }
.item-main{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.item-title{
  font-weight: 650;
}
.item-meta{
  font-size: 12px;
  color: var(--muted);
}

.badge{
  display:inline-flex;
  align-items:center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.toggle{
  width: 42px;
  height: 38px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  cursor:pointer;
}
.toggle:hover{ background:#f8fafc; }

.done .item-title{
  text-decoration: line-through;
  color: var(--muted);
}

.footer{
  margin-top: 26px;
  color: var(--muted);
  font-size: 12px;
}

@media print{
  body{ background:#fff; }
  .topbar, .grid, .btn, .toggle, form, .footer, .badge{ display:none !important; }
  .card{ box-shadow:none; border:1px solid #ddd; }
  .container{ padding:0; }
  .page-title{ font-size: 24px; }
  .subtitle{ display:none; }
  .item{ padding:6px 0; }
}


/* Mobile Edit: keep position after toggle */
.item{scroll-margin-top: 90px;}
